Skip to content

Menu style, experimental #1128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 13, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/menu/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ul>
<li class="ui-state-disabled">Ada</li>
<li>Saarland</li>
<li>Salzburg</li>
<li>Salzburg an der schönen Donau</li>
</ul>
</li>
<li>Saarland</li>
Expand Down
1 change: 1 addition & 0 deletions demos/menu/icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<li><span class="ui-icon ui-icon-seek-end"></span>Next</li>
</ul>
</li>
<li>Learn more about this menu</li>
</ul>

<div class="demo-description">
Expand Down
23 changes: 6 additions & 17 deletions themes/base/jquery.ui.menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,35 @@
*/
.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;
cursor: pointer;
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;
Expand All @@ -69,6 +57,7 @@

/* right-aligned */
.ui-menu .ui-menu-icon {
position: static;
position: relative;
top: -.2em;
float: right;
}
11 changes: 5 additions & 6 deletions ui/jquery.ui.menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $.widget( "ui.menu", {
items: "> *",
menus: "ul",
position: {
my: "left top",
my: "left-1 top",
at: "right top"
},
role: "menu",
Expand All @@ -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,
Expand Down Expand Up @@ -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" )
Expand All @@ -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" )
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down