summaryrefslogtreecommitdiffstats
path: root/public/javascripts
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 07:13:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-06-20 07:13:07 +0000
commitd3e51b4235a1c53b0ad042397a7b2ad893fc6dcc (patch)
tree0a324d19edb43090765395a5beb8817ec197a6d2 /public/javascripts
parent94c2356f383000cea42072a94b351f79ff4567d4 (diff)
downloadredmine-d3e51b4235a1c53b0ad042397a7b2ad893fc6dcc.tar.gz
redmine-d3e51b4235a1c53b0ad042397a7b2ad893fc6dcc.zip
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
Diffstat (limited to 'public/javascripts')
-rw-r--r--public/javascripts/application.js29
1 files changed, 17 insertions, 12 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index edb419be1..c1ecd86c7 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -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;
}