From 9910e938aad1090339a2c7f60693093ee18aba82 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 24 Oct 2013 14:04:00 -0400 Subject: [PATCH] Menu: Simplify styling. Remove rounded corners, reduce spacing. --- themes/base/jquery.ui.menu.css | 22 +++++----------------- ui/jquery.ui.menu.js | 11 +++++------ 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/themes/base/jquery.ui.menu.css b/themes/base/jquery.ui.menu.css index cc390cec4..c3ff16464 100644 --- a/themes/base/jquery.ui.menu.css +++ b/themes/base/jquery.ui.menu.css @@ -10,27 +10,24 @@ */ .ui-menu { list-style: none; - padding: 2px; + padding: 0; margin: 0; display: block; outline: none; } .ui-menu .ui-menu { - margin-top: -3px; position: absolute; } .ui-menu .ui-menu-item { margin: 0; display: block; - padding: 2px .4em; - line-height: 1.5; + padding: 3px .4em; min-height: 0; /* support: IE7 */ - font-weight: normal; /* support: IE10, see #8844 */ list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); } .ui-menu .ui-menu-divider { - margin: 5px -2px 5px -2px; + margin: 5px 0; height: 0; font-size: 0; line-height: 0; @@ -38,19 +35,9 @@ } .ui-menu .ui-state-focus, .ui-menu .ui-state-active { - font-weight: normal; margin: -1px; } -.ui-menu .ui-state-disabled { - font-weight: normal; - margin: .4em 0 .2em; - line-height: 1.5; -} -.ui-menu .ui-state-disabled a { - cursor: default; -} - /* icon support */ .ui-menu-icons { position: relative; @@ -69,6 +56,7 @@ /* right-aligned */ .ui-menu .ui-menu-icon { - position: static; + position: relative; + top: -.2em; float: right; } diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index b0ff38894..c5d2bc777 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -26,7 +26,7 @@ $.widget( "ui.menu", { items: "> *", menus: "ul", position: { - my: "left top", + my: "left-1 top", at: "right top" }, role: "menu", @@ -44,7 +44,7 @@ $.widget( "ui.menu", { this.mouseHandled = false; this.element .uniqueId() - .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) + .addClass( "ui-menu ui-widget ui-widget-content" ) .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ) .attr({ role: this.options.role, @@ -147,7 +147,7 @@ $.widget( "ui.menu", { this.element .removeAttr( "aria-activedescendant" ) .find( ".ui-menu" ).addBack() - .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" ) + .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons" ) .removeAttr( "role" ) .removeAttr( "tabIndex" ) .removeAttr( "aria-labelledby" ) @@ -163,7 +163,7 @@ $.widget( "ui.menu", { .removeAttr( "role" ) .removeAttr( "aria-disabled" ) .removeUniqueId() - .removeClass( "ui-corner-all ui-state-hover" ) + .removeClass( "ui-state-hover" ) .removeAttr( "tabIndex" ) .removeAttr( "role" ) .removeAttr( "aria-haspopup" ) @@ -292,7 +292,7 @@ $.widget( "ui.menu", { // Initialize nested menus submenus.filter( ":not(.ui-menu)" ) - .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) + .addClass( "ui-menu ui-widget ui-widget-content" ) .hide() .attr({ role: this.options.role, @@ -328,7 +328,6 @@ $.widget( "ui.menu", { items.not( ".ui-menu-item, .ui-menu-divider" ) .addClass( "ui-menu-item" ) .uniqueId() - .addClass( "ui-corner-all" ) .attr({ tabIndex: -1, role: this._itemRole() -- 2.39.5