Browse files

[popup] New option: "dismissable": default: true, whether a click on …

…the screen or pressing Esc will dismiss the popup - note: pressing the "Back" button on the browser will dismiss the popup no matter what
  • Loading branch information...
1 parent 3d85b49 commit 352fb0be7fa4573822bf8bcf36450a5fd2641539 @gabrielschulhof gabrielschulhof committed Oct 7, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 js/widgets/popup.js
@@ -52,6 +52,7 @@ define( [ "jquery",
closeLinkEvents: "click.popup",
navigateEvents: "navigate.popup",
closeEvents: "navigate.popup pagebeforechange.popup",
+ dismissable: true,
// NOTE Windows Phone 7 has a scroll position caching issue that
// requires us to disable popup history management by default
@@ -64,7 +65,9 @@ define( [ "jquery",
_eatEventAndClose: function( e ) {
- this.close();
+ if ( this.options.dismissable ) {
+ this.close();
+ }
return false;

4 comments on commit 352fb0b


"Please note that the correct spelling is [data-]dismissible, not [data-]dismiss_a_ble. The implementation and the popup doc page ( use the correct spelling, but the data-attributes reference uses the misspelling (" per mkelement @ #5299. Just to help before any problems may be created in the switch!


I just checked here and don't see "dismissable"


Yeah, true. Guess they updated it in the documentation.
The point was moreso for anyone using this code -- you might want to use "dismissible" vs "dismissable" if you custom edit your files. So that your code will be compatible with jqm1.2.1 or jqm1.3 (whatever will have this data-dismissible feature).


I changed it yesterday just before 1.3 beta release.

Please sign in to comment.