[PE][SSE] Don't show disconnect message on window close/reload

This commit is contained in:
Julia Radzhabova 2022-03-11 21:40:53 +03:00
parent f584fd95c2
commit 19c72eea5c
2 changed files with 16 additions and 4 deletions

View file

@ -629,6 +629,7 @@ define([
this.synchronizeChanges();
if ( id == Asc.c_oAscAsyncAction['Disconnect']) {
this._state.timerDisconnect && clearTimeout(this._state.timerDisconnect);
this.disableEditing(false, true);
this.getApplication().getController('Statusbar').hideDisconnectTip();
this.getApplication().getController('Statusbar').setStatusCaption(this.textReconnect);
@ -726,7 +727,9 @@ define([
this.disableEditing(true, true);
var me = this;
statusCallback = function() {
me.getApplication().getController('Statusbar').showDisconnectTip();
me._state.timerDisconnect = setTimeout(function(){
me.getApplication().getController('Statusbar').showDisconnectTip();
}, me._state.unloadTimer || 0);
};
break;
@ -1698,12 +1701,15 @@ define([
if (this.api.isDocumentModified()) {
var me = this;
this.api.asc_stopSaving();
this._state.unloadTimer = 1000;
this.continueSavingTimer = window.setTimeout(function() {
me.api.asc_continueSaving();
me._state.unloadTimer = 0;
}, 500);
return this.leavePageText;
}
} else
this._state.unloadTimer = 10000;
},
onUnload: function() {

View file

@ -714,6 +714,7 @@ define([
this.onEditComplete(this.loadMask, {restorefocus:true});
}
if ( id == Asc.c_oAscAsyncAction['Disconnect']) {
this._state.timerDisconnect && clearTimeout(this._state.timerDisconnect);
this.disableEditing(false, true);
this.getApplication().getController('Statusbar').hideDisconnectTip();
this.getApplication().getController('Statusbar').setStatusCaption(this.textReconnect);
@ -800,7 +801,9 @@ define([
this.disableEditing(true, true);
var me = this;
statusCallback = function() {
me.getApplication().getController('Statusbar').showDisconnectTip();
me._state.timerDisconnect = setTimeout(function(){
me.getApplication().getController('Statusbar').showDisconnectTip();
}, me._state.unloadTimer || 0);
};
break;
@ -2067,12 +2070,15 @@ define([
if (isEdit && this.api.asc_isDocumentModified()) {
var me = this;
this.api.asc_stopSaving();
this._state.unloadTimer = 1000;
this.continueSavingTimer = window.setTimeout(function() {
me.api.asc_continueSaving();
me._state.unloadTimer = 0;
}, 500);
return this.leavePageText;
}
} else
this._state.unloadTimer = 10000;
},
onUnload: function() {