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 <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Owen Leonard 2010-11-13 14:14:39 -05:00 committed by Chris Cormack
parent 00408e262f
commit 1024eceec7
2 changed files with 27 additions and 28 deletions

View File

@ -7,7 +7,7 @@
<!-- TMPL_LOOP NAME="languages_loop" -->
<!-- TMPL_IF NAME="group_enabled" -->
<!-- TMPL_IF NAME="plural" -->
<li class="more"><a id="showlang" href="#"><!-- TMPL_VAR NAME="native_description" --> (<!-- TMPL_VAR NAME="rfc4646_subtag" -->)</a><div id="sublangs">
<li class="more"><a class="sublangs" id="show<!-- TMPL_VAR NAME="rfc4646_subtag" -->" href="#"><!-- TMPL_VAR NAME="native_description" --> (<!-- TMPL_VAR NAME="rfc4646_subtag" -->)</a><div id="sub<!-- TMPL_VAR NAME="rfc4646_subtag" -->">
<div class="bd"><ul>
<!-- TMPL_LOOP NAME="sublanguages_loop" -->
<!-- TMPL_IF NAME="enabled" -->

View File

@ -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 });
$(".sublangs").each(function(){
var menuid = $(this).attr("id");
var menuid = menuid.replace("show","");
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);
});
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