mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
Fix error handling before document is ready
This commit is contained in:
@ -1378,6 +1378,8 @@ define([
|
||||
$('.doc-placeholder').remove();
|
||||
|
||||
this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (Common.Utils.InternalSettings.get("guest-username")===null) && this.showRenameUserDialog();
|
||||
if (this._needToSaveAsFile) // warning received before document is ready
|
||||
this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas');
|
||||
},
|
||||
|
||||
onLicenseChanged: function(params) {
|
||||
@ -2068,8 +2070,12 @@ define([
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
if (this.appOptions.isDesktopApp && this.appOptions.isOffline)
|
||||
this.api.asc_DownloadAs();
|
||||
else
|
||||
(this.appOptions.canDownload) ? this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas') : this.api.asc_DownloadOrigin();
|
||||
else {
|
||||
if (this.appOptions.canDownload) {
|
||||
this._isDocReady ? this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas') : (this._needToSaveAsFile = true);
|
||||
} else
|
||||
this.api.asc_DownloadOrigin();
|
||||
}
|
||||
} else if (id == Asc.c_oAscError.ID.SplitCellMaxRows || id == Asc.c_oAscError.ID.SplitCellMaxCols || id == Asc.c_oAscError.ID.SplitCellRowsDivider) {
|
||||
var me = this;
|
||||
setTimeout(function(){
|
||||
|
||||
@ -358,7 +358,7 @@ define([
|
||||
this.$el.show();
|
||||
this.scroller.update();
|
||||
this.selectMenu(panel, opts, defPanel);
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
this.api && this.api.asc_enableKeyEvents(false);
|
||||
|
||||
this.fireEvent('menu:show', [this]);
|
||||
},
|
||||
|
||||
@ -999,6 +999,8 @@ define([
|
||||
|
||||
$('.doc-placeholder').remove();
|
||||
this.appOptions.user.guest && this.appOptions.canRenameAnonymous && (Common.Utils.InternalSettings.get("guest-username")===null) && this.showRenameUserDialog();
|
||||
if (this._needToSaveAsFile) // warning received before document is ready
|
||||
this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas');
|
||||
},
|
||||
|
||||
onLicenseChanged: function(params) {
|
||||
@ -1663,7 +1665,11 @@ define([
|
||||
config.callback = _.bind(function(btn){
|
||||
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && this.appOptions.canDownload) {
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
(this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.api.asc_DownloadAs() : this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas');
|
||||
if (this.appOptions.isDesktopApp && this.appOptions.isOffline)
|
||||
this.api.asc_DownloadAs();
|
||||
else {
|
||||
this._isDocReady ? this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas') : (this._needToSaveAsFile = true);
|
||||
}
|
||||
} else if (id == Asc.c_oAscError.ID.SplitCellMaxRows || id == Asc.c_oAscError.ID.SplitCellMaxCols || id == Asc.c_oAscError.ID.SplitCellRowsDivider) {
|
||||
var me = this;
|
||||
setTimeout(function(){
|
||||
|
||||
@ -1082,6 +1082,8 @@ define([
|
||||
Common.Gateway.documentReady();
|
||||
if (this.appOptions.user.guest && this.appOptions.canRenameAnonymous && !this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle && (Common.Utils.InternalSettings.get("guest-username")===null))
|
||||
this.showRenameUserDialog();
|
||||
if (this._needToSaveAsFile) // warning received before document is ready
|
||||
this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas');
|
||||
},
|
||||
|
||||
onLicenseChanged: function(params) {
|
||||
@ -2059,7 +2061,11 @@ define([
|
||||
config.callback = _.bind(function(btn){
|
||||
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && this.appOptions.canDownload) {
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
(this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.api.asc_DownloadAs() : this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas');
|
||||
if (this.appOptions.isDesktopApp && this.appOptions.isOffline)
|
||||
this.api.asc_DownloadAs();
|
||||
else {
|
||||
this._isDocReady ? this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas') : (this._needToSaveAsFile = true);
|
||||
}
|
||||
} else if (id == Asc.c_oAscError.ID.EditingError) {
|
||||
this.disableEditing(true);
|
||||
Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print
|
||||
|
||||
Reference in New Issue
Block a user