diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index eaf50a6ce..d9aafc98a 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -170,6 +170,18 @@ define([ Common.Gateway.on('showmessage', _.bind(me.onExternalMessage, me)); Common.Gateway.on('opendocument', _.bind(me.loadDocument, me)); Common.Gateway.appReady(); + + Common.Gateway.on('internalcommand', function(data) { + if (data.command=='hardBack') { + if ($('.modal-in').length>0) { + if ( !$(me.loadMask).hasClass('modal-in') ) + uiApp.closeModal(); + Common.Gateway.internalMessage('hardBack', false); + } else + Common.Gateway.internalMessage('hardBack', true); + } + }); + Common.Gateway.internalMessage('listenHardBack'); } }, diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index 5660cfcb7..6452b65dc 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -169,6 +169,18 @@ define([ Common.Gateway.on('showmessage', _.bind(me.onExternalMessage, me)); Common.Gateway.on('opendocument', _.bind(me.loadDocument, me)); Common.Gateway.appReady(); + + Common.Gateway.on('internalcommand', function(data) { + if (data.command=='hardBack') { + if ($('.modal-in').length>0) { + if ( !$(me.loadMask).hasClass('modal-in') ) + uiApp.closeModal(); + Common.Gateway.internalMessage('hardBack', false); + } else + Common.Gateway.internalMessage('hardBack', true); + } + }); + Common.Gateway.internalMessage('listenHardBack'); } me.initNames(); diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index d691cfe1b..5daeb9fb7 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -175,6 +175,18 @@ define([ Common.Gateway.on('showmessage', _.bind(me.onExternalMessage, me)); Common.Gateway.on('opendocument', _.bind(me.loadDocument, me)); Common.Gateway.appReady(); + + Common.Gateway.on('internalcommand', function(data) { + if (data.command=='hardBack') { + if ($('.modal-in').length>0) { + if ( !$(me.loadMask).hasClass('modal-in') ) + uiApp.closeModal(); + Common.Gateway.internalMessage('hardBack', false); + } else + Common.Gateway.internalMessage('hardBack', true); + } + }); + Common.Gateway.internalMessage('listenHardBack'); } },