summaryrefslogtreecommitdiffstats
path: root/public/javascripts/application.js
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-14 20:13:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-14 20:13:29 +0000
commit1c11d3403e4ed3518d51ef3d44cefc3cb1f6d548 (patch)
treed57251ae1dd829f2e4f2ee59c0fbc6693ccf9c24 /public/javascripts/application.js
parent09e47a3b6325c109c63a70dc47a9a8e32e762b44 (diff)
downloadredmine-1c11d3403e4ed3518d51ef3d44cefc3cb1f6d548.tar.gz
redmine-1c11d3403e4ed3518d51ef3d44cefc3cb1f6d548.zip
Adds buttons to scroll the tabs when they overflow.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3174 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'public/javascripts/application.js')
-rw-r--r--public/javascripts/application.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index cc75c8180..1a5e0c04f 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -73,6 +73,55 @@ function showTab(name) {
return false;
}
+function moveTabRight(el) {
+ var lis = Element.up(el, 'div.tabs').down('ul').childElements();
+ var tabsWidth = 0;
+ var i;
+ for (i=0; i<lis.length; i++) {
+ if (lis[i].visible()) {
+ tabsWidth += lis[i].getWidth() + 6;
+ }
+ }
+ if (tabsWidth < Element.up(el, 'div.tabs').getWidth() - 60) {
+ return;
+ }
+ i=0;
+ while (i<lis.length && !lis[i].visible()) {
+ i++;
+ }
+ lis[i].hide();
+}
+
+function moveTabLeft(el) {
+ var lis = Element.up(el, 'div.tabs').down('ul').childElements();
+ var i = 0;
+ while (i<lis.length && !lis[i].visible()) {
+ i++;
+ }
+ if (i>0) {
+ lis[i-1].show();
+ }
+}
+
+function displayTabsButtons() {
+ var lis;
+ var tabsWidth = 0;
+ var i;
+ $$('div.tabs').each(function(el) {
+ lis = el.down('ul').childElements();
+ for (i=0; i<lis.length; i++) {
+ if (lis[i].visible()) {
+ tabsWidth += lis[i].getWidth() + 6;
+ }
+ }
+ if (tabsWidth < el.getWidth() - 60) {
+ el.down('div.tabs-buttons').hide();
+ } else {
+ el.down('div.tabs-buttons').show();
+ }
+ });
+}
+
function setPredecessorFieldsVisibility() {
relationType = $('relation_relation_type');
if (relationType && relationType.value == "precedes") {