Fix Bug 37531
This commit is contained in:
parent
f912758bd4
commit
b9f8990fee
|
@ -150,7 +150,7 @@ define([
|
||||||
function onResetUsers(collection, opts) {
|
function onResetUsers(collection, opts) {
|
||||||
var usercount = collection.getEditingCount();
|
var usercount = collection.getEditingCount();
|
||||||
if ( $userList ) {
|
if ( $userList ) {
|
||||||
if ( usercount > 1 || usercount > 0 && appConfig && !appConfig.isEdit) {
|
if ( usercount > 1 || usercount > 0 && appConfig && !appConfig.isEdit && !appConfig.canComments) {
|
||||||
$userList.html(templateUserList({
|
$userList.html(templateUserList({
|
||||||
users: collection.models,
|
users: collection.models,
|
||||||
usertpl: _.template(templateUserItem),
|
usertpl: _.template(templateUserItem),
|
||||||
|
@ -172,7 +172,8 @@ define([
|
||||||
};
|
};
|
||||||
|
|
||||||
function applyUsers(count) {
|
function applyUsers(count) {
|
||||||
if ( count > 1 || count > 0 && appConfig && !appConfig.isEdit) {
|
var has_edit_users = count > 1 || count > 0 && appConfig && !appConfig.isEdit && !appConfig.canComments; // has other user(s) who edit document
|
||||||
|
if ( has_edit_users ) {
|
||||||
$btnUsers
|
$btnUsers
|
||||||
.attr('data-toggle', 'dropdown')
|
.attr('data-toggle', 'dropdown')
|
||||||
.addClass('dropdown-toggle')
|
.addClass('dropdown-toggle')
|
||||||
|
@ -189,13 +190,13 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
$btnUsers.find('.caption')
|
$btnUsers.find('.caption')
|
||||||
.css({'font-size': ((count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? '12px' : '14px'),
|
.css({'font-size': ((has_edit_users) ? '12px' : '14px'),
|
||||||
'margin-top': ((count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? '0' : '-1px')})
|
'margin-top': ((has_edit_users) ? '0' : '-1px')})
|
||||||
.html((count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? count : '+');
|
.html((has_edit_users) ? count : '+');
|
||||||
|
|
||||||
var usertip = $btnUsers.data('bs.tooltip');
|
var usertip = $btnUsers.data('bs.tooltip');
|
||||||
if ( usertip ) {
|
if ( usertip ) {
|
||||||
usertip.options.title = (count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? usertip.options.titleExt : usertip.options.titleNorm;
|
usertip.options.title = (has_edit_users) ? usertip.options.titleExt : usertip.options.titleNorm;
|
||||||
usertip.setContent();
|
usertip.setContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,7 +248,7 @@ define([
|
||||||
|
|
||||||
var editingUsers = storeUsers.getEditingCount();
|
var editingUsers = storeUsers.getEditingCount();
|
||||||
$btnUsers.tooltip({
|
$btnUsers.tooltip({
|
||||||
title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit) ? me.tipViewUsers : me.tipAccessRights,
|
title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit && !appConfig.canComments) ? me.tipViewUsers : me.tipAccessRights,
|
||||||
titleNorm: me.tipAccessRights,
|
titleNorm: me.tipAccessRights,
|
||||||
titleExt: me.tipViewUsers,
|
titleExt: me.tipViewUsers,
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
|
@ -263,7 +264,7 @@ define([
|
||||||
});
|
});
|
||||||
|
|
||||||
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length)?'show':'hide']();
|
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length)?'show':'hide']();
|
||||||
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit || !mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.canComments || !mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
||||||
|
|
||||||
if ( $saveStatus ) {
|
if ( $saveStatus ) {
|
||||||
$saveStatus.attr('data-width', me.textSaveExpander);
|
$saveStatus.attr('data-width', me.textSaveExpander);
|
||||||
|
|
Loading…
Reference in a new issue