Permalink
Browse files

Menu: Simplify styling. Remove rounded corners, reduce spacing.

  • Loading branch information...
scottgonzalez authored and jzaefferer committed Oct 24, 2013
1 parent 8748658 commit 9910e938aad1090339a2c7f60693093ee18aba82
Showing with 10 additions and 23 deletions.
  1. +5 −17 themes/base/jquery.ui.menu.css
  2. +5 −6 ui/jquery.ui.menu.js
@@ -10,47 +10,34 @@
*/
.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;
border-width: 1px 0 0 0;
}
.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;
}
View
@@ -26,7 +26,7 @@ $.widget( "ui.menu", {
items: "> *",
menus: "ul",
position: {
my: "left top",
my: "left-1 top",

This comment has been minimized.

Show comment
Hide comment
@jzaefferer

jzaefferer Nov 15, 2013

Member

This, and probably some of the other changes here, broke a lot of menu unit tests.

@jzaefferer

jzaefferer Nov 15, 2013

Member

This, and probably some of the other changes here, broke a lot of menu unit tests.

This comment has been minimized.

Show comment
Hide comment
@jzaefferer

jzaefferer Nov 15, 2013

Member

Fixed in 3945a8f

This comment has been minimized.

Show comment
Hide comment
@jzaefferer

jzaefferer Nov 15, 2013

Member

Runs fine with PhantomJS on my local machine, but still fails on Travis: https://travis-ci.org/jquery/jquery-ui/builds/14018788

@jzaefferer

jzaefferer Nov 15, 2013

Member

Runs fine with PhantomJS on my local machine, but still fails on Travis: https://travis-ci.org/jquery/jquery-ui/builds/14018788

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()

0 comments on commit 9910e93

Please sign in to comment.