For Bug 23603, Bug 32790 (add to rev. 470a0483bb)

This commit is contained in:
Julia Radzhabova 2019-01-10 14:00:30 +03:00
parent 04bd8e2c62
commit 04bf403d3b
4 changed files with 26 additions and 4 deletions

View file

@ -383,6 +383,7 @@ define([
},
onDownloadAs: function(format) {
this._state.isFromGatewayDownloadAs = true;
var _format = (format && (typeof format == 'string')) ? Asc.c_oAscFileType[ format.toUpperCase() ] : null,
_supported = [
Asc.c_oAscFileType.PPTX,
@ -1391,7 +1392,9 @@ define([
},
onDownloadUrl: function(url) {
Common.Gateway.downloadAs(url);
if (this._state.isFromGatewayDownloadAs)
Common.Gateway.downloadAs(url);
this._state.isFromGatewayDownloadAs = false;
},
onUpdateVersion: function(callback) {

View file

@ -144,6 +144,7 @@ define([
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
Common.NotificationCenter.on('download:cancel', _.bind(this.onDownloadCancel, this));
/** coauthoring begin **/
if (this.mode.canCoAuthoring) {
if (this.mode.canChat)
@ -338,6 +339,10 @@ define([
this.isFromFileDownloadAs = false;
},
onDownloadCancel: function() {
this.isFromFileDownloadAs = false;
},
applySettings: function(menu) {
var value = Common.localStorage.getItem("sse-settings-fontrender");
Common.Utils.InternalSettings.set("sse-settings-fontrender", value);

View file

@ -168,6 +168,7 @@ define([
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('goback', _.bind(this.goBack, this));
Common.NotificationCenter.on('namedrange:locked', _.bind(this.onNamedRangeLocked, this));
Common.NotificationCenter.on('download:cancel', _.bind(this.onDownloadCancel, this));
this.stackLongActions = new Common.IrregularStack({
strongCompare : this._compareActionStrong,
@ -408,6 +409,7 @@ define([
},
onDownloadAs: function(format) {
this._state.isFromGatewayDownloadAs = true;
var _format = (format && (typeof format == 'string')) ? Asc.c_oAscFileType[ format.toUpperCase() ] : null,
_supported = [
Asc.c_oAscFileType.XLSX,
@ -1526,7 +1528,13 @@ define([
},
onDownloadUrl: function(url) {
Common.Gateway.downloadAs(url);
if (this._state.isFromGatewayDownloadAs)
Common.Gateway.downloadAs(url);
this._state.isFromGatewayDownloadAs = false;
},
onDownloadCancel: function() {
this._state.isFromGatewayDownloadAs = false;
},
onUpdateVersion: function(callback) {

View file

@ -227,7 +227,11 @@ define([
},
openPrintSettings: function(type, cmp, format, asUrl) {
if (this.printSettingsDlg && this.printSettingsDlg.isVisible()) return;
if (this.printSettingsDlg && this.printSettingsDlg.isVisible()) {
asUrl && Common.NotificationCenter.trigger('download:cancel');
return;
}
if (this.api) {
this.asUrl = asUrl;
this.downloadFormat = format;
@ -266,8 +270,10 @@ define([
Common.NotificationCenter.trigger('edit:complete', view);
} else
return true;
} else
} else {
this.asUrl && Common.NotificationCenter.trigger('download:cancel');
Common.NotificationCenter.trigger('edit:complete', view);
}
this.printSettingsDlg = null;
},