diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-23 20:42:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-23 20:42:15 +0000 |
commit | 24ec30b10c2ec25a65e370204ddbe9d9acb151d0 (patch) | |
tree | 2974030c11ec06fad7080e186a8adc28f766c1d6 /public | |
parent | 152a5da64df7c1de74ff7f6a4fda25121100de00 (diff) | |
download | redmine-24ec30b10c2ec25a65e370204ddbe9d9acb151d0.tar.gz redmine-24ec30b10c2ec25a65e370204ddbe9d9acb151d0.zip |
SCM browser:
* open subfolders are preserved when collapsing/re-expanding a folder
* prevent a folder to be loaded twice if double-clicked while loading
git-svn-id: http://redmine.rubyforge.org/svn/trunk@868 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public')
-rw-r--r-- | public/javascripts/application.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 075bb7a90..5ad04e91d 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -74,6 +74,9 @@ function expandScmEntry(id) { var els = document.getElementsByClassName(id, 'browser'); for (var i = 0; i < els.length; i++) { Element.show(els[i]); + if (els[i].hasClassName('loaded') && !els[i].hasClassName('collapsed')) { + expandScmEntry(els[i].id); + } } $(id).addClassName('open'); } @@ -82,17 +85,24 @@ function scmEntryClick(id) { el = $(id); if (el.hasClassName('open')) { collapseScmEntry(id); + el.addClassName('collapsed'); return false; } else if (el.hasClassName('loaded')) { expandScmEntry(id); + el.removeClassName('collapsed'); return false; } + if (el.hasClassName('loading')) { + return false; + } + el.addClassName('loading'); return true; } function scmEntryLoaded(id) { Element.addClassName(id, 'open'); Element.addClassName(id, 'loaded'); + Element.removeClassName(id, 'loading'); } /* shows and hides ajax indicator */ |