File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 57855785 },
57865786 "cordovaWebviewUsed" : {
57875787 "message" : " used"
5788+ },
5789+ "cordovaExitAppTitle" : {
5790+ "message" : " Confirmation"
5791+ },
5792+ "cordovaExitAppMessage" : {
5793+ "message" : " Do you really want to close the configurator?"
57885794 }
57895795}
Original file line number Diff line number Diff line change @@ -187,6 +187,19 @@ function startProcess() {
187187 chrome . runtime . onSuspend . addListener ( closeHandler ) ;
188188 } else if ( GUI . isCordova ( ) ) {
189189 window . addEventListener ( 'beforeunload' , closeHandler ) ;
190+ document . addEventListener ( 'backbutton' , function ( e ) {
191+ e . preventDefault ( ) ;
192+ navigator . notification . confirm (
193+ i18n . getMessage ( 'cordovaExitAppMessage' ) ,
194+ function ( stat ) {
195+ if ( stat === 1 ) {
196+ navigator . app . exitApp ( ) ;
197+ }
198+ } ,
199+ i18n . getMessage ( 'cordovaExitAppTitle' ) ,
200+ [ i18n . getMessage ( 'yes' ) , i18n . getMessage ( 'no' ) ]
201+ ) ;
202+ } ) ;
190203 }
191204
192205 $ ( '.connect_b a.connect' ) . removeClass ( 'disabled' ) ;
You can’t perform that action at this time.
0 commit comments