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 58325832 },
58335833 "cordovaWebviewUsed" : {
58345834 "message" : " used"
5835+ },
5836+ "cordovaExitAppTitle" : {
5837+ "message" : " Confirmation"
5838+ },
5839+ "cordovaExitAppMessage" : {
5840+ "message" : " Do you really want to close the configurator?"
58355841 }
58365842}
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