From ebcf1e01694edd6c6ad8410c2e8922b80ef38f08 Mon Sep 17 00:00:00 2001 From: SecretR Date: Tue, 7 May 2013 16:11:32 +0300 Subject: [PATCH] Fixed #212: backward compatibility of admin menu third party plugins --- e107_web/js/core/admin.jquery.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/e107_web/js/core/admin.jquery.js b/e107_web/js/core/admin.jquery.js index ac3393f5c..679ba97a1 100644 --- a/e107_web/js/core/admin.jquery.js +++ b/e107_web/js/core/admin.jquery.js @@ -348,19 +348,21 @@ $(document).ready(function() $(this).closest("li").removeClass("active"); $(this).switchClass( "link-active", "link", 0 ); }); - var id = $(this).attr("href"), hash = id.substr(1), form = $('.admin-menu')[0]; // FIXME - a better way to detect the page form + var id = $(this).attr("href"), hash = id.split('#')[1], form = $('.admin-menu')[0]; // FIXME - a better way to detect the page form + $(this).switchClass( "link", "link-active", 30 ); $(this).closest("li").addClass("active"); $(id).removeClass('e-hideme').show({ effect: "slide" }); // 'remember' the active navigation pane - window.location.hash = 'nav-' + hash; - if(form) { - $(form).attr('action', $(form).attr('action').split('#')[0] + '#nav-' + hash); - } - - return false; //FIXME See admin/prefs navigation. + if(hash) { + window.location.hash = 'nav-' + hash; + if(form) { + $(form).attr('action', $(form).attr('action').split('#')[0] + '#nav-' + hash); + } + return false; + } }); // plugin navigation hash