aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.selectmenu.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2013-04-29 22:19:53 +0200
committerFelix Nagel <info@felixnagel.com>2013-04-29 22:19:53 +0200
commitee9c4434c2b86dd50389e63f6a5f2b5bd5a336b8 (patch)
treecf47eee99abd627b787ecb3a7b7b0b22f6241625 /ui/jquery.ui.selectmenu.js
parent0631d7666f908fadf26653742ebc5d4099dd5b85 (diff)
downloadjquery-ui-ee9c4434c2b86dd50389e63f6a5f2b5bd5a336b8.tar.gz
jquery-ui-ee9c4434c2b86dd50389e63f6a5f2b5bd5a336b8.zip
Selectmenu: adjust comments, trim trailing spaces
Diffstat (limited to 'ui/jquery.ui.selectmenu.js')
-rw-r--r--ui/jquery.ui.selectmenu.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index 3d0d9e378..756a09f90 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -40,10 +40,10 @@ $.widget( "ui.selectmenu", {
_create: function() {
var selectmenuId = this.element.uniqueId().attr( "id" );
- this.ids = {
- element: selectmenuId,
- button: selectmenuId + "-button",
- menu: selectmenuId + "-menu"
+ this.ids = {
+ element: selectmenuId,
+ button: selectmenuId + "-button",
+ menu: selectmenuId + "-menu"
};
this._drawButton();
@@ -133,7 +133,7 @@ $.widget( "ui.selectmenu", {
},
focus: function( event, ui ) {
var item = ui.item.data( "ui-selectmenu-item" );
-
+
// prevent inital focus from firing and checks if its a newly focused item
if ( !that.isOpen && that.focusIndex !== undefined && item.index !== that.focusIndex ) {
that._trigger( "focus", event, { item: item } );
@@ -143,15 +143,13 @@ $.widget( "ui.selectmenu", {
}
that.focusIndex = item.index;
- // Set ARIA active descendant
that.button.attr( "aria-activedescendant", that.menuItems.eq( item.index ).attr( "id" ) );
},
- // Set ARIA role
role: "listbox"
})
.menu( "instance" );
- // Adjust border radius
+ // adjust menu styles to dropdown
this.menu.addClass( "ui-corner-bottom" ).removeClass( "ui-corner-all" );
// Make sure focus stays on selected item
@@ -173,6 +171,7 @@ $.widget( "ui.selectmenu", {
this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" ).find( "a" );
item = this._getSelectedItem();
+
// Make sure menu is selected item aware
this.menu.menu( "focus", null, item );
this._setAria( item.data( "ui-selectmenu-item" ) );
@@ -376,7 +375,6 @@ $.widget( "ui.selectmenu", {
var link = this.menuItems.eq( item.index ),
id = link.attr( "id" );
- // Change ARIA attr
this.button.attr({
"aria-labelledby": id,
"aria-activedescendant": id