From 2adda472fcbff24a804d5b1ef92997acd518f0ca Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 3 Feb 2012 20:43:09 +0100 Subject: [PATCH 1/3] Highlight button for currently opened dialog --- static/css/pad.css | 8 ++++++++ static/js/pad_editbar.js | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/static/css/pad.css b/static/css/pad.css index be9d9656..6a5ff902 100644 --- a/static/css/pad.css +++ b/static/css/pad.css @@ -1290,3 +1290,11 @@ label { font-size: 11px; font-weight: bold; } + +.selected { + background: #eee; + background: -webkit-linear-gradient(#EEE, #F0F0F0); + background: -moz-linear-gradient(#EEE, #F0F0F0); + background: -ms-linear-gradient(#EEE, #F0F0F0); + background: -o-linear-gradient(#EEE, #F0F0F0); +} diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js index e6ff9adf..71053d0c 100644 --- a/static/js/pad_editbar.js +++ b/static/js/pad_editbar.js @@ -168,11 +168,12 @@ var padeditbar = (function() }, toogleDropDown: function(moduleName) { - var modules = ["embed", "users", "readonly", "importexport", "settingsmenu"]; + var modules = ["settingsmenu", "importexport", "embed", "users"]; //hide all modules if(moduleName == "none") { + $("#editbar ul#menu_right > li").removeClass("selected"); for(var i=0;i Date: Fri, 3 Feb 2012 20:48:47 +0100 Subject: [PATCH 2/3] overwrite existing bg --- static/css/pad.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/css/pad.css b/static/css/pad.css index 6a5ff902..b877bad8 100644 --- a/static/css/pad.css +++ b/static/css/pad.css @@ -1292,9 +1292,9 @@ label { } .selected { - background: #eee; - background: -webkit-linear-gradient(#EEE, #F0F0F0); - background: -moz-linear-gradient(#EEE, #F0F0F0); - background: -ms-linear-gradient(#EEE, #F0F0F0); - background: -o-linear-gradient(#EEE, #F0F0F0); + background: #eee !important; + background: -webkit-linear-gradient(#EEE, #F0F0F0) !important; + background: -moz-linear-gradient(#EEE, #F0F0F0) !important; + background: -ms-linear-gradient(#EEE, #F0F0F0) !important; + background: -o-linear-gradient(#EEE, #F0F0F0) !important; } From a8cc61545cbf66a6fb608927a9f6116ce4226b4d Mon Sep 17 00:00:00 2001 From: 0ip Date: Fri, 3 Feb 2012 22:29:43 +0100 Subject: [PATCH 3/3] Prevent that li.sepereator gets .selected --- static/js/pad_editbar.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js index 71053d0c..9280bc7b 100644 --- a/static/js/pad_editbar.js +++ b/static/js/pad_editbar.js @@ -190,8 +190,11 @@ var padeditbar = (function() } else { - $("#editbar ul#menu_right li:not(:nth-child(" + (modules.indexOf(moduleName) + 1) + "))").removeClass("selected"); - $("#editbar ul#menu_right li:nth-child(" + (modules.indexOf(moduleName) + 1) + ")").toggleClass("selected"); + var nth_child = modules.indexOf(moduleName) + 1; + if (nth_child > 0 && nth_child <= 3) { + $("#editbar ul#menu_right li:not(:nth-child(" + nth_child + "))").removeClass("selected"); + $("#editbar ul#menu_right li:nth-child(" + nth_child + ")").toggleClass("selected"); + } //hide all modules that are not selected and show the selected one for(var i=0;i