You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2013/07/03 10:58:23 UTC
svn commit: r1499276 -
/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js
Author: lofwyr
Date: Wed Jul 3 08:58:23 2013
New Revision: 1499276
URL: http://svn.apache.org/r1499276
Log:
TOBAGO-1280: Dropdown Menu did not work on toolbar commands
- last fix breaks key events for the normal menu (access keys)
Modified:
myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js
Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js?rev=1499276&r1=1499275&r2=1499276&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-menu.js Wed Jul 3 08:58:23 2013
@@ -206,9 +206,15 @@ Tobago.Menu.switchOn = function(menuBar,
.add(menuBar.find('li').tobagoMenu_findSubMenu().find('li')) // add sub menus
.bind('mouseover', Tobago.Menu.mouseOver)
.children('a')
- .bind('focusin', Tobago.Menu.open)
+ .on('focus', Tobago.Menu.open)
.bind(compatibleKeyEvent(), Tobago.Menu.handelKey);
- menu.children('a').focusin();
+ if (menu.parents(".tobago-toolBar").size() == 0 && menu.parents(".tobago-box-headerToolBar").size() == 0) {
+ menu.children('a').trigger("focus");
+ } else {
+ // XXX the call in the previous line doesn't work with toolBar -> dropDown (don't know why), so using direct call
+ // XXX the problem is since updating jQuery from 1.6.4 to 1.10.1
+ menu.children('a').each(Tobago.Menu.open);
+ }
jQuery("body").bind('click', Tobago.Menu.closeAll);
menuBar.data('menu-active', true); // write state back
};
@@ -220,7 +226,7 @@ Tobago.Menu.switchOff = function(menuBar
menuBar.find('li').add(menuBar.find('li').tobagoMenu_findSubMenu().find('li'))
.unbind('mouseover', Tobago.Menu.mouseOver)
.children('a')
- .unbind('focusin', Tobago.Menu.open)
+ .off('focus', Tobago.Menu.open)
.unbind(compatibleKeyEvent(), Tobago.Menu.handelKey);
jQuery("body").unbind('click', Tobago.Menu.closeAll);
menuBar.find('.tobago-menu-markup-selected').removeClass("tobago-menu-markup-selected");