Commit 0dcb2312 by 王东红

fix

parent e308c5b6
...@@ -504,6 +504,7 @@ define([ ...@@ -504,6 +504,7 @@ define([
var categoryParent, html; var categoryParent, html;
$(this.element).off('click mousedown mouseenter mouseleave'); $(this.element).off('click mousedown mouseenter mouseleave');
this._on({ this._on({
/** /**
...@@ -557,7 +558,7 @@ define([ ...@@ -557,7 +558,7 @@ define([
/** /**
* @param {jQuery.Event} event * @param {jQuery.Event} event
*/ */
'mouseenter .ui-menu-item': function (event) { 'mouseenter .level0.ui-menu-item': function (event) {
var target = $(event.currentTarget), var target = $(event.currentTarget),
submenu = this.options.menus, submenu = this.options.menus,
ulElement, ulElement,
...@@ -566,9 +567,10 @@ define([ ...@@ -566,9 +567,10 @@ define([
targetPageX, targetPageX,
rightBound; rightBound;
if (target.has("div.submenu")) { if (target.has("div.submenu")) {
var dropdown = target.find("div.submenu");
var dropdown = target.find("div.submenu");
if (this.breezeTimeout) { if (this.breezeTimeout) {
clearTimeout(this.breezeTimeout); clearTimeout(this.breezeTimeout);
delete this.breezeTimeout; delete this.breezeTimeout;
...@@ -581,10 +583,11 @@ define([ ...@@ -581,10 +583,11 @@ define([
/** /**
* @param {jQuery.Event} event * @param {jQuery.Event} event
*/ */
'mouseleave .ui-menu-item': function (event) { 'mouseleave .level0.ui-menu-item': function (event) {
var target = $(event.currentTarget) var target = $(event.currentTarget)
var dropdown = target.find("div.submenu"); var dropdown = target.find("div.submenu");
setTimeout(function () {
this.breezeTimeout = setTimeout(function () {
this.close(dropdown); this.close(dropdown);
}.bind(this), 80); }.bind(this), 80);
}, },
...@@ -636,16 +639,21 @@ define([ ...@@ -636,16 +639,21 @@ define([
this._trigger('beforeOpen', { this._trigger('beforeOpen', {
dropdown: dropdown dropdown: dropdown
}); });
var self = this
$('div.submenu.shown').each(function () {
if (dropdown.parent('li')[0].className != $(this).parent('li')[0].className) {
self.close($(this));
}
});
dropdown.addClass('shown') dropdown.addClass('shown')
.parent('li') .parent('li')
.addClass('opened'); .addClass('opened');
if (true) { if (true) {
dropdown.find("ul.subchildmenu").show() dropdown.find("ul.subchildmenu").show()
console.log(dropdown.find("ul.subchildmenu"))
if (dropdown.hasClass('subchildmenu')) { if (dropdown.hasClass('subchildmenu')) {
dropdown.find(".subchildmenu").show(); dropdown.find(".subchildmenu").show();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment