From 1024eceec715fed2f5c38ac6998ff9be75240280 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sat, 13 Nov 2010 14:14:39 -0500 Subject: [PATCH] Fix for Bug 5048, Error in menu/submenu for select language in intranet Patch for HEAD. This issue was apparently solved quite a while ago in the OPAC. This patch copies that solution over to the staff client. Signed-off-by: Galen Charlton Signed-off-by: Chris Cormack --- .../prog/en/includes/intranet-bottom.inc | 2 +- .../intranet-tmpl/prog/en/js/staff-global.js | 55 +++++++++---------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc index 78334b202d..839c1760c1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc @@ -7,7 +7,7 @@ -
  • ()
    +
  • " href="#"> ()
    ">
      diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js index c2e6fba2ed..047bfa0921 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -43,35 +43,34 @@ function _(s) { return s } // dummy function for gettext YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMoremenu); }); +// build Change Language menus YAHOO.util.Event.onContentReady("changelanguage", function () { - var oMenu = new YAHOO.widget.Menu("sublangs", { zindex: 2 }); - - function positionoMenu() { - oMenu.align("bl", "tl"); - } - - oMenu.subscribe("beforeShow", function () { - if (this.getRoot() == this) { - positionoMenu(); - } - }); - - oMenu.render(); - - oMenu.cfg.setProperty("context", ["showlang", "bl", "tl"]); - - function onYahooClick(p_oEvent) { - // Position and display the menu - positionoMenu(); - oMenu.show(); - // Stop propagation and prevent the default "click" behavior - YAHOO.util.Event.stopEvent(p_oEvent); - } - - YAHOO.util.Event.addListener("showlang", "click", onYahooClick); - - YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu); - }); + $(".sublangs").each(function(){ + var menuid = $(this).attr("id"); + var menuid = menuid.replace("show",""); + + var oMenu = new YAHOO.widget.Menu("sub"+menuid, { zindex: 2 }); + function positionoMenu() { + oMenu.align("bl", "tl"); + } + oMenu.subscribe("beforeShow", function () { + if (this.getRoot() == this) { + positionoMenu(); + } + }); + oMenu.render(); + oMenu.cfg.setProperty("context", ["show"+menuid, "bl", "tl"]); + function onYahooClick(p_oEvent) { + // Position and display the menu + positionoMenu(); + oMenu.show(); + // Stop propagation and prevent the default "click" behavior + YAHOO.util.Event.stopEvent(p_oEvent); + } + YAHOO.util.Event.addListener("show"+menuid, "click", onYahooClick); + YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu); + }); +}); // http://jennifermadden.com/javascript/stringEnterKeyDetector.html function checkEnter(e){ //e is event object passed from function invocation -- 2.39.5