From 85b5d88c12dfe7de0af2d031204b796b1c95f564 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 6 Aug 2019 10:49:13 +0300 Subject: [PATCH] [DE] Fix rev. c0862be9b9a764d88f676845284d160708d3e4af (Change downloading as TXT/ RTF) --- apps/documenteditor/main/app/controller/LeftMenu.js | 10 ++++++++-- apps/documenteditor/mobile/app/controller/Settings.js | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index e361dca68..475cd6fa4 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -302,7 +302,10 @@ define([ buttons: ['ok', 'cancel'], callback: _.bind(function(btn){ if (btn == 'ok') { - Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, this.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); + if (format == Asc.c_oAscFileType.TXT) + Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, this.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); + else + this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); menu.hide(); } }, this) @@ -348,7 +351,10 @@ define([ callback: _.bind(function(btn){ if (btn == 'ok') { this.isFromFileDownloadAs = ext; - Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, this.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format, true)); + if (format == Asc.c_oAscFileType.TXT) + Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, this.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format, true)); + else + this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format, true)); menu.hide(); } }, this) diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 9fe1c30e3..d122f1bf6 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -568,7 +568,10 @@ define([ (format === Asc.c_oAscFileType.TXT) ? me.warnDownloadAs : me.warnDownloadAsRTF, me.notcriticalErrorTitle, function () { - Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); + if (format == Asc.c_oAscFileType.TXT) + Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.TXT, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); + else + me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); } ); });