[#808] Show issue description diffs in the lightbox popup
This commit is contained in:
parent
4acee9e989
commit
38d0d530b0
@ -95,6 +95,7 @@ class JournalsController < ApplicationController
|
|||||||
@issue = @journal.journaled
|
@issue = @journal.journaled
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { }
|
format.html { }
|
||||||
|
format.js { render :layout => false }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
render_404
|
render_404
|
||||||
|
@ -617,4 +617,31 @@ jQuery(document).ready(function($) {
|
|||||||
$('#nav-login-content').click(function(event){
|
$('#nav-login-content').click(function(event){
|
||||||
event.stopPropagation();
|
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();
|
||||||
});
|
});
|
||||||
|
@ -127,7 +127,7 @@ module JournalFormatter
|
|||||||
#
|
#
|
||||||
# Truncates the content. Adds a link to view a diff.
|
# Truncates the content. Adds a link to view a diff.
|
||||||
def format_html_diff_detail(key, label, old_value, value)
|
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)
|
old_value = truncate(old_value, :length => 80)
|
||||||
value = truncate(value, :length => 80) + " " + link
|
value = truncate(value, :length => 80) + " " + link
|
||||||
[old_value, value]
|
[old_value, value]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user