From 654902b5d7ff69623fc2435e3857d662f7077f4c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 10 Jan 2019 16:20:27 +0300 Subject: [PATCH] For Bug 36883 ("goback" in current page when get critical error) --- apps/documenteditor/main/app/controller/Main.js | 6 +++--- apps/documenteditor/mobile/app/controller/Main.js | 6 +++--- apps/presentationeditor/main/app/controller/Main.js | 8 ++++---- apps/presentationeditor/mobile/app/controller/Main.js | 6 +++--- apps/spreadsheeteditor/main/app/controller/Main.js | 6 +++--- apps/spreadsheeteditor/mobile/app/controller/Main.js | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 5441821e1..64fcb4b4b 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -591,10 +591,10 @@ define([ app.getController('LeftMenu').SetDisabled(disable, true); }, - goBack: function() { + goBack: function(current) { if ( !Common.Controllers.Desktop.process('goback') ) { var href = this.appOptions.customization.goback.url; - if (this.appOptions.customization.goback.blank!==false) { + if (!current && this.appOptions.customization.goback.blank!==false) { window.open(href, "_blank"); } else { parent.location.href = href; @@ -1452,7 +1452,7 @@ define([ config.msg += '

' + this.criticalErrorExtText; config.callback = function(btn) { if (btn == 'ok') - Common.NotificationCenter.trigger('goback'); + Common.NotificationCenter.trigger('goback', true); } } if (id == Asc.c_oAscError.ID.DataEncrypted) { diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 87aa9f4ae..cc691a9ba 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -316,9 +316,9 @@ define([ } }, - goBack: function() { + goBack: function(current) { var href = this.appOptions.customization.goback.url; - if (this.appOptions.customization.goback.blank!==false) { + if (!current && this.appOptions.customization.goback.blank!==false) { window.open(href, "_blank"); } else { parent.location.href = href; @@ -906,7 +906,7 @@ define([ if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp) { config.msg += '

' + this.criticalErrorExtText; config.callback = function() { - Common.NotificationCenter.trigger('goback'); + Common.NotificationCenter.trigger('goback', true); } } if (id == Asc.c_oAscError.ID.DataEncrypted) { diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 6334dfbcd..d68d5d7cb 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -407,11 +407,11 @@ define([ } }, - goBack: function() { + goBack: function(current) { var me = this; if ( !Common.Controllers.Desktop.process('goback') ) { var href = me.appOptions.customization.goback.url; - if (me.appOptions.customization.goback.blank!==false) { + if (!current && me.appOptions.customization.goback.blank!==false) { window.open(href, "_blank"); } else { parent.location.href = href; @@ -1185,9 +1185,9 @@ define([ if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp && typeof id !== 'string') { config.msg += '

' + this.criticalErrorExtText; - config.fn = function(btn) { + config.callback = function(btn) { if (btn == 'ok') { - Common.NotificationCenter.trigger('goback'); + Common.NotificationCenter.trigger('goback', true); } } } diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js index 4f973e754..ca2c55995 100644 --- a/apps/presentationeditor/mobile/app/controller/Main.js +++ b/apps/presentationeditor/mobile/app/controller/Main.js @@ -306,9 +306,9 @@ define([ this.api.asc_DownloadAs(Asc.c_oAscFileType.PPTX, true); }, - goBack: function() { + goBack: function(current) { var href = this.appOptions.customization.goback.url; - if (this.appOptions.customization.goback.blank!==false) { + if (!current && this.appOptions.customization.goback.blank!==false) { window.open(href, "_blank"); } else { parent.location.href = href; @@ -856,7 +856,7 @@ define([ if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp) { config.msg += '

' + this.criticalErrorExtText; config.callback = function() { - Common.NotificationCenter.trigger('goback'); + Common.NotificationCenter.trigger('goback', true); } } if (id == Asc.c_oAscError.ID.DataEncrypted) { diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 13d90aa02..d35dd8231 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -434,11 +434,11 @@ define([ } }, - goBack: function() { + goBack: function(current) { var me = this; if ( !Common.Controllers.Desktop.process('goback') ) { var href = me.appOptions.customization.goback.url; - if (me.appOptions.customization.goback.blank!==false) { + if (!current && me.appOptions.customization.goback.blank!==false) { window.open(href, "_blank"); } else { parent.location.href = href; @@ -1350,7 +1350,7 @@ define([ config.msg += '

' + this.criticalErrorExtText; config.callback = function(btn) { if (btn == 'ok') { - Common.NotificationCenter.trigger('goback'); + Common.NotificationCenter.trigger('goback', true); } } } diff --git a/apps/spreadsheeteditor/mobile/app/controller/Main.js b/apps/spreadsheeteditor/mobile/app/controller/Main.js index 63d867455..ba9b95f9d 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Main.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Main.js @@ -309,9 +309,9 @@ define([ this.api.asc_DownloadAs(Asc.c_oAscFileType.XLSX, true); }, - goBack: function() { + goBack: function(current) { var href = this.appOptions.customization.goback.url; - if (this.appOptions.customization.goback.blank!==false) { + if (!current && this.appOptions.customization.goback.blank!==false) { window.open(href, "_blank"); } else { parent.location.href = href; @@ -990,7 +990,7 @@ define([ if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp) { config.msg += '

' + this.criticalErrorExtText; config.callback = function() { - Common.NotificationCenter.trigger('goback'); + Common.NotificationCenter.trigger('goback', true); } } if (id == Asc.c_oAscError.ID.DataEncrypted) {