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

Commit 352fb0b

Browse files
author
Gabriel Schulhof
committed
[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
1 parent 3d85b49 commit 352fb0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/widgets/popup.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ define( [ "jquery",
5252
closeLinkEvents: "click.popup",
5353
navigateEvents: "navigate.popup",
5454
closeEvents: "navigate.popup pagebeforechange.popup",
55+
dismissable: true,
5556

5657
// NOTE Windows Phone 7 has a scroll position caching issue that
5758
// requires us to disable popup history management by default
@@ -64,7 +65,9 @@ define( [ "jquery",
6465
_eatEventAndClose: function( e ) {
6566
e.preventDefault();
6667
e.stopImmediatePropagation();
67-
this.close();
68+
if ( this.options.dismissable ) {
69+
this.close();
70+
}
6871
return false;
6972
},
7073

0 commit comments

Comments
 (0)