[DE mobile] [PE mobile] [SSE mobile] Hide Collaboration when no edit users
This commit is contained in:
parent
98fa231d51
commit
5a009e4c90
|
@ -761,6 +761,8 @@ define([
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
me.api.asc_registerCallback('asc_onSendThemeColors', _.bind(me.onSendThemeColors, me));
|
me.api.asc_registerCallback('asc_onSendThemeColors', _.bind(me.onSendThemeColors, me));
|
||||||
me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me));
|
me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me));
|
||||||
|
me.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
||||||
|
me.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -778,8 +780,6 @@ define([
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
|
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
|
||||||
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
|
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
|
||||||
me.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
|
||||||
me.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
|
|
||||||
if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) {
|
if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) {
|
||||||
|
@ -795,6 +795,10 @@ 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();
|
||||||
|
|
|
@ -253,6 +253,10 @@ 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();
|
||||||
|
if (_userCount > 0) {
|
||||||
|
$('#settings-collaboration').show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,8 @@ define([
|
||||||
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
|
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_onFocusObject', _.bind(this.onApiFocusObject, this));
|
||||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
|
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.displayCollaboration, this))
|
||||||
|
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.displayCollaboration, this));
|
||||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -192,6 +194,21 @@ define([
|
||||||
DE.getController('Settings').hideModal();
|
DE.getController('Settings').hideModal();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
displayCollaboration: function(users) {
|
||||||
|
if(users !== undefined) {
|
||||||
|
var length = 0;
|
||||||
|
_.each(users, function (item) {
|
||||||
|
if (!item.asc_getView())
|
||||||
|
length++;
|
||||||
|
});
|
||||||
|
if (length > 0) {
|
||||||
|
$('#toolbar-collaboration').show();
|
||||||
|
} else {
|
||||||
|
$('#toolbar-collaboration').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
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',
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if(phone) {%>
|
<% if(phone) {%>
|
||||||
<li>
|
<li>
|
||||||
<div id="settings-collaboration" class="item-content">
|
<div id="settings-collaboration" class="item-content" style="display: none;">
|
||||||
<div class="item-media">
|
<div class="item-media">
|
||||||
<i class="icon icon-collaboration"></i>
|
<i class="icon icon-collaboration"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (!phone) { %>
|
<% if (!phone) { %>
|
||||||
<a href="#" id="toolbar-collaboration" class="link icon-only disabled">
|
<a href="#" id="toolbar-collaboration" class="link icon-only disabled" style="display: none;">
|
||||||
<i class="icon icon-collaboration"></i>
|
<i class="icon icon-collaboration"></i>
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
|
@ -703,6 +703,8 @@ define([
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
me.api.asc_registerCallback('asc_onSendThemeColors', _.bind(me.onSendThemeColors, me));
|
me.api.asc_registerCallback('asc_onSendThemeColors', _.bind(me.onSendThemeColors, me));
|
||||||
me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me));
|
me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me));
|
||||||
|
me.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
||||||
|
me.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -725,8 +727,6 @@ define([
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
|
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
|
||||||
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
|
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
|
||||||
me.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
|
||||||
me.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
|
|
||||||
if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) {
|
if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) {
|
||||||
|
@ -1153,6 +1153,10 @@ 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);
|
||||||
|
|
|
@ -165,6 +165,11 @@ 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();
|
||||||
|
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');
|
||||||
Common.Utils.addScrollIfNeed('.page[data-page=settings-info-view]', '.page[data-page=settings-info-view] .page-content');
|
Common.Utils.addScrollIfNeed('.page[data-page=settings-info-view]', '.page[data-page=settings-info-view] .page-content');
|
||||||
|
|
|
@ -80,6 +80,8 @@ define([
|
||||||
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
|
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_onFocusObject', _.bind(this.onApiFocusObject, this));
|
||||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
|
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.displayCollaboration, this))
|
||||||
|
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.displayCollaboration, this));
|
||||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -196,6 +198,21 @@ define([
|
||||||
PE.getController('Settings').hideModal();
|
PE.getController('Settings').hideModal();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
displayCollaboration: function(users) {
|
||||||
|
if(users !== undefined) {
|
||||||
|
var length = 0;
|
||||||
|
_.each(users, function (item) {
|
||||||
|
if (!item.asc_getView())
|
||||||
|
length++;
|
||||||
|
});
|
||||||
|
if (length > 0) {
|
||||||
|
$('#toolbar-collaboration').show();
|
||||||
|
} else {
|
||||||
|
$('#toolbar-collaboration').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
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',
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if(phone) {%>
|
<% if(phone) {%>
|
||||||
<li>
|
<li>
|
||||||
<div id="settings-collaboration" class="item-content">
|
<div id="settings-collaboration" class="item-content" style="display: none;">
|
||||||
<div class="item-media">
|
<div class="item-media">
|
||||||
<i class="icon icon-collaboration"></i>
|
<i class="icon icon-collaboration"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (!phone) { %>
|
<% if (!phone) { %>
|
||||||
<a href="#" id="toolbar-collaboration" class="link icon-only disabled">
|
<a href="#" id="toolbar-collaboration" class="link icon-only disabled" style="display: none;">
|
||||||
<i class="icon icon-collaboration"></i>
|
<i class="icon icon-collaboration"></i>
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
|
@ -715,6 +715,8 @@ define([
|
||||||
me.api.asc_registerCallback('asc_onSendThemeColors', _.bind(me.onSendThemeColors, me));
|
me.api.asc_registerCallback('asc_onSendThemeColors', _.bind(me.onSendThemeColors, me));
|
||||||
me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me));
|
me.api.asc_registerCallback('asc_onDownloadUrl', _.bind(me.onDownloadUrl, me));
|
||||||
}
|
}
|
||||||
|
me.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
||||||
|
me.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
||||||
},
|
},
|
||||||
|
|
||||||
applyModeEditorElements: function() {
|
applyModeEditorElements: function() {
|
||||||
|
@ -729,8 +731,6 @@ define([
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
|
me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me));
|
||||||
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
|
me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me));
|
||||||
me.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
|
||||||
me.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(me.onAuthParticipantsChanged, me));
|
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
if (me.appOptions.isEditDiagram)
|
if (me.appOptions.isEditDiagram)
|
||||||
me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onSelectionChanged, me));
|
me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onSelectionChanged, me));
|
||||||
|
@ -1335,6 +1335,10 @@ 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"),
|
||||||
|
|
|
@ -205,6 +205,11 @@ define([
|
||||||
me.initSpreadsheetPageSize();
|
me.initSpreadsheetPageSize();
|
||||||
} else if ('#margins-view' == pageId) {
|
} else if ('#margins-view' == pageId) {
|
||||||
me.initSpreadsheetMargins();
|
me.initSpreadsheetMargins();
|
||||||
|
} else {
|
||||||
|
var _userCount = SSE.getController('Main').returnUserCount();
|
||||||
|
if (_userCount > 0) {
|
||||||
|
$('#settings-collaboration').show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,8 @@ define([
|
||||||
this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onApiWorksheetLocked, 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_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this));
|
||||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
|
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.displayCollaboration, this))
|
||||||
|
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.displayCollaboration, this));
|
||||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||||
|
|
||||||
Common.NotificationCenter.on('sheet:active', this.onApiActiveSheetChanged.bind(this));
|
Common.NotificationCenter.on('sheet:active', this.onApiActiveSheetChanged.bind(this));
|
||||||
|
@ -219,6 +221,21 @@ define([
|
||||||
SSE.getController('Settings').hideModal();
|
SSE.getController('Settings').hideModal();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
displayCollaboration: function(users) {
|
||||||
|
if(users !== undefined) {
|
||||||
|
var length = 0;
|
||||||
|
_.each(users, function (item) {
|
||||||
|
if (!item.asc_getView())
|
||||||
|
length++;
|
||||||
|
});
|
||||||
|
if (length > 0) {
|
||||||
|
$('#toolbar-collaboration').show();
|
||||||
|
} else {
|
||||||
|
$('#toolbar-collaboration').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
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',
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if(phone) {%>
|
<% if(phone) {%>
|
||||||
<li>
|
<li>
|
||||||
<div id="settings-collaboration" class="item-content">
|
<div id="settings-collaboration" class="item-content" style="display: none;">
|
||||||
<div class="item-media">
|
<div class="item-media">
|
||||||
<i class="icon icon-collaboration"></i>
|
<i class="icon icon-collaboration"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (!phone) { %>
|
<% if (!phone) { %>
|
||||||
<a href="#" id="toolbar-collaboration" class="link icon-only disabled">
|
<a href="#" id="toolbar-collaboration" class="link icon-only disabled" style="display: none;">
|
||||||
<i class="icon icon-collaboration"></i>
|
<i class="icon icon-collaboration"></i>
|
||||||
</a>
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
Loading…
Reference in a new issue