From b9f8990fee1353a2af19c3d52f0cc3b418f3f00b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 20 Apr 2018 11:23:58 +0300 Subject: [PATCH] Fix Bug 37531 --- apps/common/main/lib/view/Header.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 55742ce3e..9a8b8a01b 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -150,7 +150,7 @@ define([ function onResetUsers(collection, opts) { var usercount = collection.getEditingCount(); if ( $userList ) { - if ( usercount > 1 || usercount > 0 && appConfig && !appConfig.isEdit) { + if ( usercount > 1 || usercount > 0 && appConfig && !appConfig.isEdit && !appConfig.canComments) { $userList.html(templateUserList({ users: collection.models, usertpl: _.template(templateUserItem), @@ -172,7 +172,8 @@ define([ }; 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 .attr('data-toggle', 'dropdown') .addClass('dropdown-toggle') @@ -189,13 +190,13 @@ define([ } $btnUsers.find('.caption') - .css({'font-size': ((count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? '12px' : '14px'), - 'margin-top': ((count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? '0' : '-1px')}) - .html((count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? count : '+'); + .css({'font-size': ((has_edit_users) ? '12px' : '14px'), + 'margin-top': ((has_edit_users) ? '0' : '-1px')}) + .html((has_edit_users) ? count : '+'); var usertip = $btnUsers.data('bs.tooltip'); 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(); } } @@ -247,7 +248,7 @@ define([ var editingUsers = storeUsers.getEditingCount(); $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, titleExt: me.tipViewUsers, placement: 'bottom', @@ -263,7 +264,7 @@ define([ }); $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 ) { $saveStatus.attr('data-width', me.textSaveExpander);