From c730f5a60e232021f7ac9b58389a9534643a38be Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 20 Jun 2018 16:57:06 +0300 Subject: [PATCH] [DE mobile] Bug 37649 (add events for closing application by Back button) --- apps/documenteditor/mobile/app/controller/Main.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index f08120938..14a12cb0a 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'); } },