Skip to content

Commit 5804736

Browse files
author
Ihor Melnychenko
committed
MAGETWO-32234: Subcategories in menu are shown instantly when user moves mouse quickly
- Added delay config and fix
1 parent 5f6d157 commit 5804736

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/web/mage/menu.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,13 @@ define([
349349
}, 300);
350350
}
351351
},
352-
_delay: function(handler, delay) {
353-
this._super(handler, delay);
352+
_delay: function( handler, delay ) {
353+
var instance = this,
354+
handlerProxy = function () {
355+
return ( typeof handler === "string" ? instance[ handler ] : handler )
356+
.apply( instance, arguments );
357+
};
358+
return setTimeout( handlerProxy, delay || 0 );
354359
}
355360
});
356361

0 commit comments

Comments
 (0)