Skip to content

Commit

Permalink
Selectmenu: renaming of internal variable opened to isOpen
Browse files Browse the repository at this point in the history
  • Loading branch information
fnagel committed Nov 2, 2011
1 parent 02ac48f commit 6edc790
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ui/jquery.ui.selectmenu.js
Expand Up @@ -138,7 +138,7 @@ $.widget( "ui.selectmenu", {
that._trigger( "change", event, { item: item } ); that._trigger( "change", event, { item: item } );
} }


if ( that.opened ) { if ( that.isOpen ) {
event.preventDefault(); event.preventDefault();
that.close( event, true); that.close( event, true);
} }
Expand All @@ -157,7 +157,7 @@ $.widget( "ui.selectmenu", {
// document click closes menu // document click closes menu
this._bind( document, { this._bind( document, {
'click': function( event ) { 'click': function( event ) {
if ( this.opened && !$( event.target ).closest( "#" + this.ids.button).length ) { if ( this.isOpen && !$( event.target ).closest( "#" + this.ids.button).length ) {
this.close( event ); this.close( event );
} }
} }
Expand Down Expand Up @@ -227,21 +227,21 @@ $.widget( "ui.selectmenu", {
of: this.button of: this.button
}, this.options.position )); }, this.options.position ));


this.opened = true; this.isOpen = true;
this._trigger( "open", event ); this._trigger( "open", event );
} }
}, },


close: function( event, focus ) { close: function( event, focus ) {
if ( this.opened ) { if ( this.isOpen ) {
if ( this.options.dropdown ) { if ( this.options.dropdown ) {
this.button this.button
.addClass( 'ui-corner-all' ) .addClass( 'ui-corner-all' )
.removeClass( 'ui-corner-top' ); .removeClass( 'ui-corner-top' );
} }


this.menuWrap.removeClass( 'ui-selectmenu-open' ); this.menuWrap.removeClass( 'ui-selectmenu-open' );
this.opened = false; this.isOpen = false;


if ( focus ) { if ( focus ) {
this.button.focus(); this.button.focus();
Expand Down Expand Up @@ -286,13 +286,13 @@ $.widget( "ui.selectmenu", {
}, },


_move: function( key, event ) { _move: function( key, event ) {
if ( !this.opened ) { if ( !this.isOpen ) {
this.menu.menu( "focus", event, this._getSelectedItem() ); this.menu.menu( "focus", event, this._getSelectedItem() );
} }


this.menu.menu( key, event ); this.menu.menu( key, event );


if ( !this.opened ) { if ( !this.isOpen ) {
this.menu.menu( "select", event ); this.menu.menu( "select", event );
} }
}, },
Expand All @@ -302,7 +302,7 @@ $.widget( "ui.selectmenu", {
}, },


_toggle: function( event ) { _toggle: function( event ) {
if ( this.opened ) { if ( this.isOpen ) {
this.close( event ); this.close( event );
} else { } else {
this.open( event ); this.open( event );
Expand All @@ -317,12 +317,12 @@ $.widget( "ui.selectmenu", {
keydown: function( event ) { keydown: function( event ) {
switch (event.keyCode) { switch (event.keyCode) {
case $.ui.keyCode.TAB: case $.ui.keyCode.TAB:
if ( this.opened ) { if ( this.isOpen ) {
this.close( event ); this.close( event );
} }
break; break;
case $.ui.keyCode.ENTER: case $.ui.keyCode.ENTER:
if ( this.opened ) { if ( this.isOpen ) {
this.menu.menu( "select", this._getSelectedItem() ); this.menu.menu( "select", this._getSelectedItem() );
} }
event.preventDefault(); event.preventDefault();
Expand Down

0 comments on commit 6edc790

Please sign in to comment.