* @param {jQuery} $target - the submenu to toggle
*/
AccordionMenu.prototype.toggle = function($target){
+ var _this = this;
+ var setHideTimeout = function() {
+ $target.data('toggleTimeout', setTimeout(function () {
+ _this.down($target);
+ }, 200));
+ };
if (!$target.is(':hidden')) {
+ clearTimeout($target.data('toggleTimeout'));
this.up($target);
}
else {
- this.down($target);
+ if (typeof $target.data('toggleTimeout') !== 'undefined')
+ clearTimeout($target.data('toggleTimeout'));
+ setHideTimeout();
}
};
/**