Skip to content

Commit a0ffdef

Browse files
author
Gabriel Schulhof
committed
Custom select: Removing some references to "self" in build().
1 parent 0356e67 commit a0ffdef

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

js/widgets/forms/select.custom.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,23 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
109109
});
110110

111111
// Create list from select, update state
112-
self.refresh();
112+
this.refresh();
113113

114-
if ( self._origTabIndex === undefined ) {
115-
// Map undefined to false, because self._origTabIndex === undefined
114+
if ( this._origTabIndex === undefined ) {
115+
// Map undefined to false, because this._origTabIndex === undefined
116116
// indicates that we have not yet checked whether the select has
117117
// originally had a tabindex attribute, whereas false indicates that
118118
// we have checked the select for such an attribute, and have found
119119
// none present.
120-
self._origTabIndex = ( self.select[ 0 ].getAttribute( "tabindex" ) === null ) ? false : self.select.attr( "tabindex" );
120+
this._origTabIndex = ( this.select[ 0 ].getAttribute( "tabindex" ) === null ) ? false : this.select.attr( "tabindex" );
121121
}
122-
self.select.attr( "tabindex", "-1" ).focus(function() {
122+
this.select.attr( "tabindex", "-1" ).focus(function() {
123123
$( this ).blur();
124124
self.button.focus();
125125
});
126126

127127
// Button events
128-
self.button.bind( "vclick keydown" , function( event ) {
128+
this.button.bind( "vclick keydown" , function( event ) {
129129
if ( self.options.disabled || self.isOpen ) {
130130
return;
131131
}
@@ -145,7 +145,7 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
145145
});
146146

147147
// Events for list items
148-
self.list.attr( "role", "listbox" )
148+
this.list.attr( "role", "listbox" )
149149
.bind( "focusin", function( e ) {
150150
$( e.target )
151151
.attr( "tabindex", "0" )
@@ -216,7 +216,7 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
216216

217217
// button refocus ensures proper height calculation
218218
// by removing the inline style and ensuring page inclusion
219-
self.menuPage.bind( "pagehide", function() {
219+
this.menuPage.bind( "pagehide", function() {
220220
// TODO centralize page removal binding / handling in the page plugin.
221221
// Suggestion from @jblas to do refcounting
222222
//
@@ -233,13 +233,13 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
233233
});
234234

235235
// Events on the popup
236-
self.listbox.bind( "popupafterclose", function() {
236+
this.listbox.bind( "popupafterclose", function() {
237237
self.close();
238238
});
239239

240240
// Close button on small overlays
241-
if ( self.isMultiple ) {
242-
self.headerClose.click(function() {
241+
if ( this.isMultiple ) {
242+
this.headerClose.click(function() {
243243
if ( self.menuType === "overlay" ) {
244244
self.close();
245245
return false;
@@ -249,7 +249,7 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
249249

250250
// track this dependency so that when the parent page
251251
// is removed on pagehide it will also remove the menupage
252-
self.thisPage.addDependents( this.menuPage );
252+
this.thisPage.addDependents( this.menuPage );
253253

254254
return this;
255255
},

0 commit comments

Comments
 (0)