From a8cc61545cbf66a6fb608927a9f6116ce4226b4d Mon Sep 17 00:00:00 2001 From: 0ip Date: Fri, 3 Feb 2012 22:29:43 +0100 Subject: [PATCH] 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