Merge pull request #558 from ONLYOFFICE/fix/bugfix

Fix Bug 47191
This commit is contained in:
Julia Radzhabova 2020-11-10 23:41:05 +03:00 committed by GitHub
commit c3498b7351
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) { onExternalMessage: function(msg) {
if (msg && msg.msg) { if (msg && msg.msg) {
msg.msg = (msg.msg).toString(); msg.msg = (msg.msg).toString();

View file

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

View file

@ -53,6 +53,7 @@ define([
// private // private
var stateDisplayMode = false; var stateDisplayMode = false;
var _users = []; var _users = [];
var _displayCollaboration = false;
return { return {
models: [], models: [],
@ -201,10 +202,8 @@ define([
if ((item.asc_getState()!==false) && !item.asc_getView()) if ((item.asc_getState()!==false) && !item.asc_getView())
length++; length++;
}); });
if (length < 1 && this.mode && !this.mode.canViewComments && !this.mode.canReview && !this.mode.canViewReview) _displayCollaboration = (length >= 1 || !this.mode || this.mode.canViewComments || this.mode.canReview || this.mode.canViewReview);
$('#toolbar-collaboration').hide(); _displayCollaboration ? $('#toolbar-collaboration').show() : $('#toolbar-collaboration').hide();
else
$('#toolbar-collaboration').show();
} }
}, },
@ -228,6 +227,10 @@ define([
this.displayCollaboration(); this.displayCollaboration();
}, },
getDisplayCollaboration: function() {
return _displayCollaboration;
},
dlgLeaveTitleText : 'You leave the application', 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.', 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', leaveButtonText : 'Leave this Page',

View file

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

View file

@ -166,10 +166,7 @@ define([
$('#settings-print').single('click', _.bind(me._onPrint, me)); $('#settings-print').single('click', _.bind(me._onPrint, me));
$('#settings-collaboration').single('click', _.bind(me.onCollaboration, me)); $('#settings-collaboration').single('click', _.bind(me.onCollaboration, me));
var _userCount = PE.getController('Main').returnUserCount(); PE.getController('Toolbar').getDisplayCollaboration() && $('#settings-collaboration').show();
if (_userCount > 0) {
$('#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-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'); 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() { PE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() {
// private // private
var _users = []; var _users = [];
var _displayCollaboration = false;
return { return {
models: [], models: [],
@ -210,10 +211,8 @@ define([
if ((item.asc_getState()!==false) && !item.asc_getView()) if ((item.asc_getState()!==false) && !item.asc_getView())
length++; length++;
}); });
if (length < 1 && this.mode && !this.mode.canViewComments) _displayCollaboration = (length >= 1 || !this.mode || this.mode.canViewComments);
$('#toolbar-collaboration').hide(); _displayCollaboration ? $('#toolbar-collaboration').show() : $('#toolbar-collaboration').hide();
else
$('#toolbar-collaboration').show();
} }
}, },
@ -237,6 +236,10 @@ define([
this.displayCollaboration(); this.displayCollaboration();
}, },
getDisplayCollaboration: function() {
return _displayCollaboration;
},
dlgLeaveTitleText : 'You leave the application', 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.', 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', leaveButtonText : 'Leave this Page',

View file

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

View file

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

View file

@ -56,6 +56,7 @@ define([
sheet: false sheet: false
}; };
var _users = []; var _users = [];
var _displayCollaboration = false;
return { return {
models: [], models: [],
@ -229,10 +230,8 @@ define([
if ((item.asc_getState()!==false) && !item.asc_getView()) if ((item.asc_getState()!==false) && !item.asc_getView())
length++; length++;
}); });
if (length < 1 && this.mode && !this.mode.canViewComments) _displayCollaboration = (length >= 1 || !this.mode || this.mode.canViewComments);
$('#toolbar-collaboration').hide(); _displayCollaboration ? $('#toolbar-collaboration').show() : $('#toolbar-collaboration').hide();
else
$('#toolbar-collaboration').show();
} }
}, },
@ -256,6 +255,10 @@ define([
this.displayCollaboration(); this.displayCollaboration();
}, },
getDisplayCollaboration: function() {
return _displayCollaboration;
},
dlgLeaveTitleText : 'You leave the application', 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.', 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', leaveButtonText : 'Leave this Page',