Commit d8809ce7 by 王东红

fix

parent d20c3398
...@@ -1586,6 +1586,16 @@ footer{ ...@@ -1586,6 +1586,16 @@ footer{
.account .sidebar.sidebar-main{ .account .sidebar.sidebar-main{
z-index: 2; z-index: 2;
} }
.level-top.ui-menu-item > .open-children-toggle{
display: block;
position: absolute;
width: 50px;
height: 50px;
right: 10px !important;
z-index: 999999;
cursor: pointer;
margin-top: 2px;
}
} }
//.product-items .product-item-photo:hover { //.product-items .product-item-photo:hover {
// transform: scale(1.02); // transform: scale(1.02);
......
...@@ -73,7 +73,7 @@ define([ ...@@ -73,7 +73,7 @@ define([
"click .ui-state-disabled > a": function (event) { "click .ui-state-disabled > a": function (event) {
event.preventDefault(); event.preventDefault();
}, },
"click .ui-menu-item:has(a)": function (event) { "click .ui-menu-item > .open-children-toggle": function (event) {
var target = $(event.target).closest(".ui-menu-item"); var target = $(event.target).closest(".ui-menu-item");
this.active = null this.active = null
...@@ -101,6 +101,34 @@ define([ ...@@ -101,6 +101,34 @@ define([
} }
} }
}, },
"click .ui-menu-item > a": function (event) {
var target = $(event.target).closest(".ui-menu-item");
window.location.href = target.find('> a').attr('href');
this.active = null
// if (!this.mouseHandled && target.not(".ui-state-disabled").length) {
// this.select(event);
//
// // Only set the mouseHandled flag if the event will bubble, see #9469.
// if (!event.isPropagationStopped()) {
// this.mouseHandled = true;
// }
//
// // Open submenu on click
// if (target.has(".ui-menu").length) {
// this.expand(event);
// } else if (!this.element.is(":focus") && $(this.document[0].activeElement).closest(".ui-menu").length) {
//
// // Redirect focus to the menu
// this.element.trigger("focus", [true]);
//
// // If the active item is on the top level, let it stay active.
// // Otherwise, blur the active item since it is no longer visible.
// if (this.active && this.active.parents(".ui-menu").length === 1) {
// clearTimeout(this.timer);
// }
// }
// }
},
"mouseenter .ui-menu-item": function (event) { "mouseenter .ui-menu-item": function (event) {
var target = $(event.currentTarget); var target = $(event.currentTarget);
// Remove ui-state-active class from siblings of the newly focused menu item // Remove ui-state-active class from siblings of the newly focused menu item
...@@ -306,8 +334,14 @@ define([ ...@@ -306,8 +334,14 @@ define([
item = menu.parent().parent().prev("a"), item = menu.parent().parent().prev("a"),
submenuCarat = $("<span>") submenuCarat = $("<span>")
.addClass("ui-menu-icon ui-icon " + icon) .addClass("ui-menu-icon ui-icon " + icon)
.data("ui-menu-submenu-carat", true); .data("ui-menu-submenu-carat", true),
openChildrenToggle = $("<div>")
.addClass("open-children-toggle");
if(item.attr("aria-haspopup", "true").length > 0){
var menuTop = item.parent();
menuTop.prepend(openChildrenToggle);
}
item item
.attr("aria-haspopup", "true") .attr("aria-haspopup", "true")
.prepend(submenuCarat); .prepend(submenuCarat);
......
...@@ -788,7 +788,7 @@ define([ ...@@ -788,7 +788,7 @@ define([
maxItems: null, //option to set max number of menu items maxItems: null, //option to set max number of menu items
container: '#menu', //container to check against navigation length container: '#menu', //container to check against navigation length
moreText: $.mage.__('more'), moreText: $.mage.__('more'),
breakpoint: 768 breakpoint: 638
}, },
/** /**
......
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