Fix Bug 37511

This commit is contained in:
Julia Radzhabova 2018-05-23 14:43:30 +03:00
parent b8d0f3832f
commit 24b03043f4
10 changed files with 30 additions and 13 deletions

View file

@ -89,6 +89,7 @@ define([
me.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(me.onApiUserConnection, me));
me.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(me.onApiDocumentContentReady, me));
Common.NotificationCenter.on('api:disconnect', _.bind(me.onCoAuthoringDisconnect, me));
me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(me.onCoAuthoringDisconnect,me));
me.api.asc_coAuthoringGetUsers();
},

View file

@ -278,6 +278,7 @@ define([
old_rights = this._state.lostEditingRights;
this._state.lostEditingRights = !this._state.lostEditingRights;
this.api.asc_coAuthoringDisconnect();
Common.NotificationCenter.trigger('api:disconnect');
if (!old_rights) {
uiApp.alert(

View file

@ -79,6 +79,7 @@ define([
this.api.asc_registerCallback('asc_onCanUndo', _.bind(this.onApiCanRevert, this, 'undo'));
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
},
@ -176,6 +177,12 @@ define([
onCoAuthoringDisconnect: function() {
this.isDisconnected = true;
this.deactivateEditControls();
$('#toolbar-undo').toggleClass('disabled', true);
$('#toolbar-redo').toggleClass('disabled', true);
DE.getController('AddContainer').hideModal();
DE.getController('EditContainer').hideModal();
DE.getController('Settings').hideModal();
},
dlgLeaveTitleText : 'You leave the application',

View file

@ -82,6 +82,7 @@ define([
me.api.asc_registerCallback('asc_onHidePopMenu', _.bind(me.onApiHidePopMenu, me));
me.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(me.onApiDocumentContentReady, me));
Common.NotificationCenter.on('api:disconnect', _.bind(me.onCoAuthoringDisconnect, me));
me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(me.onCoAuthoringDisconnect,me));
},
setMode: function (mode) {

View file

@ -79,6 +79,7 @@ define([
this.api.asc_registerCallback('asc_onCanUndo', _.bind(this.onApiCanRevert, this, 'undo'));
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
},
@ -187,6 +188,12 @@ define([
onCoAuthoringDisconnect: function() {
this.isDisconnected = true;
this.deactivateEditControls();
$('#toolbar-undo').toggleClass('disabled', true);
$('#toolbar-redo').toggleClass('disabled', true);
PE.getController('AddContainer').hideModal();
PE.getController('EditContainer').hideModal();
PE.getController('Settings').hideModal();
},
dlgLeaveTitleText : 'You leave the application',

View file

@ -84,8 +84,8 @@ define([
this.api.asc_registerCallback('asc_onSelectionNameChanged', _.bind(this.onApiCellSelection, this));
this.api.asc_registerCallback('asc_onEditCell', _.bind(this.onApiEditCell, this));
this.api.asc_registerCallback('asc_onFormulaCompleteMenu', _.bind(this.onFormulaCompleteMenu, this));
// this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiDisconnect,this));
// Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiDisconnect, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiDisconnect,this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiDisconnect, this));
// Common.NotificationCenter.on('cells:range', _.bind(this.onCellsRange, this));
// this.api.asc_registerCallback('asc_onInputKeyDown', _.bind(this.onInputKeyDown, this));
@ -133,16 +133,7 @@ define([
onApiDisconnect: function() {
this.mode.isEdit = false;
var controller = this.getApplication().getController('FormulaDialog');
if (controller) {
controller.hideDialog();
}
if (!this.mode.isEdit) {
$('#ce-func-label', this.editor.el).addClass('disabled');
this.editor.btnNamedRanges.setVisible(false);
}
$('#ce-function').addClass('disabled');
},
onCellsRange: function(status) {

View file

@ -83,6 +83,7 @@ define([
this.api.asc_registerCallback('asc_onShowPopMenu', _.bind(this.onApiShowPopMenu, this));
this.api.asc_registerCallback('asc_onHidePopMenu', _.bind(this.onApiHidePopMenu, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect,this));
},
setMode: function (mode) {

View file

@ -279,6 +279,7 @@ define([
old_rights = this._state.lostEditingRights;
this._state.lostEditingRights = !this._state.lostEditingRights;
this.api.asc_coAuthoringDisconnect();
Common.NotificationCenter.trigger('api:disconnect');
if (!old_rights) {
uiApp.alert(

View file

@ -100,7 +100,7 @@ define([
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiDisconnect, this));
// Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiDisconnect, this));
// this.api.asc_registerCallback('asc_onUpdateTabColor', _.bind(this.onApiUpdateTabColor, this));
// this.api.asc_registerCallback('asc_onEditCell', _.bind(this.onApiEditCell, this));
this.api.asc_registerCallback('asc_onWorkbookLocked', _.bind(this.onWorkbookLocked, this));

View file

@ -86,6 +86,7 @@ define([
this.api.asc_registerCallback('asc_onWorkbookLocked', _.bind(this.onApiWorkbookLocked, this));
this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onApiWorksheetLocked, this));
this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('sheet:active', this.onApiActiveSheetChanged.bind(this));
@ -210,6 +211,12 @@ define([
onCoAuthoringDisconnect: function() {
this.isDisconnected = true;
this.deactivateEditControls();
$('#toolbar-undo').toggleClass('disabled', true);
$('#toolbar-redo').toggleClass('disabled', true);
SSE.getController('AddContainer').hideModal();
SSE.getController('EditContainer').hideModal();
SSE.getController('Settings').hideModal();
},
dlgLeaveTitleText : 'You leave the application',