Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit bdf50bf

Browse files
author
Gabriel Schulhof
committed
Custom select: Moving binding that closes popup when the user clicks onto the header's close button into the widget prototype and calling it _handleHeaderCloseClick().
1 parent 571b4f3 commit bdf50bf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

js/widgets/forms/select.custom.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
120120
$.mobile._bindPageRemove.call( this.thisPage );
121121
},
122122

123+
_handleHeaderCloseClick: function() {
124+
if ( this.menuType === "overlay" ) {
125+
this.close();
126+
return false;
127+
}
128+
},
129+
123130
build: function() {
124131
var selectId, prefix, popupId, dialogId, label, thisPage, isMultiple, menuId, themeAttr, overlayThemeAttr,
125132
dividerThemeAttr, menuPage, listbox, list, header, headerTitle, menuPageContent, menuPageClose, headerClose, self,
@@ -252,12 +259,7 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
252259

253260
// Close button on small overlays
254261
if ( this.isMultiple ) {
255-
this.headerClose.click(function() {
256-
if ( self.menuType === "overlay" ) {
257-
self.close();
258-
return false;
259-
}
260-
});
262+
this._on( this.headerClose, { click: "_handleHeaderCloseClick" } );
261263
}
262264

263265
// track this dependency so that when the parent page

0 commit comments

Comments
 (0)