File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/main/js/components/dialogs Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ let _defaults = {
1313 hideCloseButton : false ,
1414 allowEmpty : false ,
1515 submitButton : false ,
16+ preventCloseOnOutsideClick : false ,
1617} ;
1718
1819let _typeClassMap = {
@@ -66,12 +67,14 @@ Dialog.prototype.init = function () {
6667 this . dialog . dispatchEvent ( new Event ( "cancel" ) ) ,
6768 ) ;
6869 }
69- this . dialog . addEventListener ( "click" , function ( e ) {
70- if ( e . target !== e . currentTarget ) {
71- return ;
72- }
73- this . dispatchEvent ( new Event ( "cancel" ) ) ;
74- } ) ;
70+ if ( ! this . options . preventCloseOnOutsideClick ) {
71+ this . dialog . addEventListener ( "click" , function ( e ) {
72+ if ( e . target !== e . currentTarget ) {
73+ return ;
74+ }
75+ this . dispatchEvent ( new Event ( "cancel" ) ) ;
76+ } ) ;
77+ }
7578 this . ok = null ;
7679 } else {
7780 this . form = null ;
You can’t perform that action at this time.
0 commit comments