Fix Bug 47191

This commit is contained in:
Julia Radzhabova 2020-11-10 23:33:06 +03:00
parent 063bb33eb4
commit e81967d1b4
9 changed files with 24 additions and 36 deletions

View file

@ -886,10 +886,6 @@ define([
}
},
returnUserCount: function() {
return this._state.usersCount;
},
onExternalMessage: function(msg) {
if (msg && msg.msg) {
msg.msg = (msg.msg).toString();

View file

@ -269,10 +269,7 @@ define([
if(_stateDisplayMode == "final" || _stateDisplayMode == "original") {
$('#settings-document').addClass('disabled');
}
var _userCount = DE.getController('Main').returnUserCount();
if (_userCount > 0) {
$('#settings-collaboration').show();
}
DE.getController('Toolbar').getDisplayCollaboration() && $('#settings-collaboration').show();
}
},

View file

@ -53,6 +53,7 @@ define([
// private
var stateDisplayMode = false;
var _users = [];
var _displayCollaboration = false;
return {
models: [],
@ -201,10 +202,8 @@ define([
if ((item.asc_getState()!==false) && !item.asc_getView())
length++;
});
if (length < 1 && this.mode && !this.mode.canViewComments && !this.mode.canReview && !this.mode.canViewReview)
$('#toolbar-collaboration').hide();
else
$('#toolbar-collaboration').show();
_displayCollaboration = (length >= 1 || !this.mode || this.mode.canViewComments || this.mode.canReview || this.mode.canViewReview);
_displayCollaboration ? $('#toolbar-collaboration').show() : $('#toolbar-collaboration').hide();
}
},
@ -228,6 +227,10 @@ define([
this.displayCollaboration();
},
getDisplayCollaboration: function() {
return _displayCollaboration;
},
dlgLeaveTitleText : 'You leave the application',
dlgLeaveMsgText : 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
leaveButtonText : 'Leave this Page',

View file

@ -1242,10 +1242,6 @@ define([
this._state.usersCount = length;
},
returnUserCount: function() {
return this._state.usersCount;
},
onDocumentName: function(name) {
// this.getApplication().getController('Viewport').getView('Common.Views.Header').setDocumentCaption(name);
this.updateWindowTitle(true);

View file

@ -166,10 +166,7 @@ define([
$('#settings-print').single('click', _.bind(me._onPrint, me));
$('#settings-collaboration').single('click', _.bind(me.onCollaboration, me));
var _userCount = PE.getController('Main').returnUserCount();
if (_userCount > 0) {
$('#settings-collaboration').show();
}
PE.getController('Toolbar').getDisplayCollaboration() && $('#settings-collaboration').show();
Common.Utils.addScrollIfNeed('.page[data-page=settings-setup-view]', '.page[data-page=settings-setup-view] .page-content');
Common.Utils.addScrollIfNeed('.page[data-page=settings-download-view]', '.page[data-page=settings-download-view] .page-content');

View file

@ -52,6 +52,7 @@ define([
PE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() {
// private
var _users = [];
var _displayCollaboration = false;
return {
models: [],
@ -210,10 +211,8 @@ define([
if ((item.asc_getState()!==false) && !item.asc_getView())
length++;
});
if (length < 1 && this.mode && !this.mode.canViewComments)
$('#toolbar-collaboration').hide();
else
$('#toolbar-collaboration').show();
_displayCollaboration = (length >= 1 || !this.mode || this.mode.canViewComments);
_displayCollaboration ? $('#toolbar-collaboration').show() : $('#toolbar-collaboration').hide();
}
},
@ -237,6 +236,10 @@ define([
this.displayCollaboration();
},
getDisplayCollaboration: function() {
return _displayCollaboration;
},
dlgLeaveTitleText : 'You leave the application',
dlgLeaveMsgText : 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
leaveButtonText : 'Leave this Page',

View file

@ -1449,10 +1449,6 @@ define([
this._state.usersCount = length;
},
returnUserCount: function() {
return this._state.usersCount;
},
applySettings: function() {
if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
var value = Common.localStorage.getItem("sse-settings-coauthmode"),

View file

@ -261,10 +261,7 @@ define([
} else if ('#settings-macros-view' == pageId) {
me.initPageMacrosSettings();
} else {
var _userCount = SSE.getController('Main').returnUserCount();
if (_userCount > 0) {
$('#settings-collaboration').show();
}
SSE.getController('Toolbar').getDisplayCollaboration() && $('#settings-collaboration').show();
}
},

View file

@ -56,6 +56,7 @@ define([
sheet: false
};
var _users = [];
var _displayCollaboration = false;
return {
models: [],
@ -229,10 +230,8 @@ define([
if ((item.asc_getState()!==false) && !item.asc_getView())
length++;
});
if (length < 1 && this.mode && !this.mode.canViewComments)
$('#toolbar-collaboration').hide();
else
$('#toolbar-collaboration').show();
_displayCollaboration = (length >= 1 || !this.mode || this.mode.canViewComments);
_displayCollaboration ? $('#toolbar-collaboration').show() : $('#toolbar-collaboration').hide();
}
},
@ -256,6 +255,10 @@ define([
this.displayCollaboration();
},
getDisplayCollaboration: function() {
return _displayCollaboration;
},
dlgLeaveTitleText : 'You leave the application',
dlgLeaveMsgText : 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
leaveButtonText : 'Leave this Page',