File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 */
1616( function ( $ , undefined ) {
1717
18- var mouseHandled = false ;
19-
2018$ . widget ( "ui.menu" , {
2119 version : "@VERSION" ,
2220 defaultElement : "<ul>" ,
@@ -40,6 +38,7 @@ $.widget( "ui.menu", {
4038
4139 _create : function ( ) {
4240 this . activeMenu = this . element ;
41+ this . mouseHandled = false ;
4342 this . element
4443 . uniqueId ( )
4544 . addClass ( "ui-menu ui-widget ui-widget-content ui-corner-all" )
@@ -73,8 +72,8 @@ $.widget( "ui.menu", {
7372 } ,
7473 "click .ui-menu-item:has(a)" : function ( event ) {
7574 var target = $ ( event . target ) . closest ( ".ui-menu-item" ) ;
76- if ( ! mouseHandled && target . not ( ".ui-state-disabled" ) . length ) {
77- mouseHandled = true ;
75+ if ( ! this . mouseHandled && target . not ( ".ui-state-disabled" ) . length ) {
76+ this . mouseHandled = true ;
7877
7978 this . select ( event ) ;
8079 // Open submenu on click
@@ -130,7 +129,7 @@ $.widget( "ui.menu", {
130129 }
131130
132131 // Reset the mouseHandled flag
133- mouseHandled = false ;
132+ this . mouseHandled = false ;
134133 }
135134 } ) ;
136135 } ,
You can’t perform that action at this time.
0 commit comments