Browse Source

Load remote tab only once (#3058).

Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@18276 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.1.0
Jean-Philippe Lang 5 years ago
parent
commit
d3e51b4235
1 changed files with 17 additions and 12 deletions
  1. 17
    12
      public/javascripts/application.js

+ 17
- 12
public/javascripts/application.js View File

@@ -385,21 +385,26 @@ function showIssueHistory(journal, url) {
return false;
}

function getRemoteTab(name, remote_url, url) {
$('#tab-content-' + name).parent().find('.tab-content').hide();
$('#tab-content-' + name).parent().find('div.tabs a').removeClass('selected');
$('#tab-' + name).addClass('selected')
function getRemoteTab(name, remote_url, url, load_always = false) {
var tab_content = $('#tab-content-' + name);

replaceInHistory(url)
tab_content.parent().find('.tab-content').hide();
tab_content.parent().find('div.tabs a').removeClass('selected');
$('#tab-' + name).addClass('selected');

$.ajax({
url: remote_url,
type: 'get',
success: function(data){
$('#tab-content-' + name).html(data).show();
}
});
replaceInHistory(url);

if (tab_content.children().length == 0 && load_always == false) {
$.ajax({
url: remote_url,
type: 'get',
success: function(data){
tab_content.html(data)
}
});
}

tab_content.show();
return false;
}


Loading…
Cancel
Save