diff options
author | Felix Nagel <info@felixnagel.com> | 2012-01-22 13:38:34 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-01-22 13:38:34 +0100 |
commit | c5d9dbca5c32915255398d249f995681ee671bf4 (patch) | |
tree | 809d980d63c3ca65d701d1cbed4e8c9d68a83765 /ui/jquery.ui.selectmenu.js | |
parent | 04d9900c5e45be6eabecdff269648d677b79ff3b (diff) | |
download | jquery-ui-c5d9dbca5c32915255398d249f995681ee671bf4.tar.gz jquery-ui-c5d9dbca5c32915255398d249f995681ee671bf4.zip |
Selectmenu: make use of _getCreateOptions
Diffstat (limited to 'ui/jquery.ui.selectmenu.js')
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 389bc1983..5802b6848 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -55,7 +55,7 @@ $.widget( "ui.selectmenu", { this._drawMenu(); - if ( this.element.attr( 'disabled' ) ) { + if ( this.options.disabled ) { this.disable(); } }, @@ -69,7 +69,7 @@ $.widget( "ui.selectmenu", { // create button this.button = $( '<a />', { href: '#' + this.ids.id, - tabindex: ( tabindex ? tabindex : this.element.attr( 'disabled' ) ? -1 : 0 ), + tabindex: ( tabindex ? tabindex : this.options.disabled ? -1 : 0 ), id: this.ids.button, css: { width: this.element.outerWidth() @@ -174,8 +174,9 @@ $.widget( "ui.selectmenu", { this.menu.find( "li" ).not( '.ui-selectmenu-optgroup' ).find( 'a' ).attr( 'role', 'option' ); this.menu.attr( "aria-activedescendant" , this.menu.find( "li.ui-menu-item a" ).eq( this.element[0].selectedIndex ).attr( "id" ) ); - // transfer disabled state - if ( this.element.attr( 'disabled' ) ) { + // set and transfer disabled state + this._getCreateOptions(); + if ( this.options.disabled ) { this.disable(); } else { this.enable() @@ -395,6 +396,14 @@ $.widget( "ui.selectmenu", { this.button.toggleClass( 'ui-corner-top', !this.isOpen ).toggleClass( 'ui-corner-all', this.isOpen ); } }, + + _getCreateOptions: function() { + if ( this.element.attr( 'disabled' ) ) { + this.options.disabled = true; + } else { + this.options.disabled = false; + } + }, _readOptions: function() { var data = []; |