[#808] Show issue description diffs in the lightbox popup

This commit is contained in:
Eric Davis 2011-12-28 16:31:34 -08:00
parent 4acee9e989
commit 38d0d530b0
3 changed files with 29 additions and 1 deletions

View File

@ -95,6 +95,7 @@ class JournalsController < ApplicationController
@issue = @journal.journaled
respond_to do |format|
format.html { }
format.js { render :layout => false }
end
else
render_404

View File

@ -617,4 +617,31 @@ jQuery(document).ready(function($) {
$('#nav-login-content').click(function(event){
event.stopPropagation();
});
$('.lightbox-ajax').click(function(event) {
$('#dialog-window').
html('').
load(this.href, function() {
// Set width to the content width
var width = $('#content').width();
$(this).dialog("option", "width", width).dialog('open');
});
event.preventDefault();
return false;
});
// Configures the default dialog window
function setUpDialogWindow() {
$('#dialog-window').
dialog({
autoOpen: false,
minWidth: 400,
width: 800
});
}
setUpDialogWindow();
});

View File

@ -127,7 +127,7 @@ module JournalFormatter
#
# Truncates the content. Adds a link to view a diff.
def format_html_diff_detail(key, label, old_value, value)
link = link_to(l(:label_more), {:controller => 'journals', :action => 'diff', :id => id, :field => key.to_s})
link = link_to(l(:label_more), {:controller => 'journals', :action => 'diff', :id => id, :field => key.to_s}, :class => 'lightbox-ajax')
old_value = truncate(old_value, :length => 80)
value = truncate(value, :length => 80) + " " + link
[old_value, value]