diff --git a/apps/common/main/lib/component/Layout.js b/apps/common/main/lib/component/Layout.js index 3a58b30fa7..6500a47508 100644 --- a/apps/common/main/lib/component/Layout.js +++ b/apps/common/main/lib/component/Layout.js @@ -179,6 +179,50 @@ define([ doLayout: function() { }, + changeLayout: function(items) { + var panel, resizer, stretch = false; + this.panels = []; + items.forEach(function(item) { + item.el instanceof HTMLElement && (item.el = $(item.el)); + panel = _.extend(new LayoutPanel(), item); + if ( panel.stretch ) { + stretch = true; + panel.rely = false; + panel.resize = false; + } + + this.panels.push(panel); + + if (panel.resize) { + resizer = { + isresizer : true, + minpos : panel.resize.min||0, + maxpos : panel.resize.max||0, + fmin : panel.resize.fmin, + fmax : panel.resize.fmax, + behaviour : panel.behaviour, + index : this.splitters.length, + offset : panel.resize.offset || 0 + }; + + if (!stretch) { + panel.resize.el = + resizer.el = panel.el.after('
').next(); + this.panels.push(resizer); + } else { + panel.resize.el = + resizer.el = panel.el.before('
').prev(); + this.panels.splice(this.panels.length - 1, 0, resizer); + } + + this.splitters.push({resizer:resizer}); + + panel.resize.hidden && resizer.el.hide(); + Common.Gateway.on('processmouse', this.resize.eventStop); + } + }, this); + }, + getElementHeight: function(el) { return parseInt(el.css('height')); }, diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js index b09d60148a..40644084a9 100644 --- a/apps/common/main/lib/controller/Comments.js +++ b/apps/common/main/lib/controller/Comments.js @@ -194,6 +194,10 @@ define([ setMode: function(mode) { this.mode = mode; this.isModeChanged = true; // change show-comment mode from/to hint mode using canComments flag + if (!this.mode.canComments) { + this.view.changeLayout(mode); + } + return this; }, // @@ -1188,6 +1192,7 @@ define([ hideAddReply : !_.isUndefined(this.hidereply) ? this.hidereply : (this.showPopover ? true : false), scope : this.view, editable : this.mode.canEditComments || (data.asc_getUserId() == this.currentUserId), + hint : !this.mode.canComments, groupName : (groupname && groupname.length>1) ? groupname[1] : null }); if (comment) { @@ -1403,12 +1408,12 @@ define([ if ('none' !== panel.css('display')) { this.view.txtComment.focus(); } - if (this.view.needRender) - this.updateComments(true); - else if (this.view.needUpdateFilter) - this.onUpdateFilter(this.view.needUpdateFilter); - this.view.update(); } + if (this.view.needRender) + this.updateComments(true); + else if (this.view.needUpdateFilter) + this.onUpdateFilter(this.view.needUpdateFilter); + this.view.update(); } }, diff --git a/apps/common/main/lib/template/Comments.template b/apps/common/main/lib/template/Comments.template index 3899e288c9..bd2986c3f8 100644 --- a/apps/common/main/lib/template/Comments.template +++ b/apps/common/main/lib/template/Comments.template @@ -10,7 +10,7 @@ <% if (quote!==null && quote!=='') { %>
<%=scope.getFixedQuote(quote)%>
<% } %> - <% if (!editText) { %> + <% if (!editText || hint) { %>
<%=scope.pickLink(comment)%>
<% } else { %>
@@ -24,20 +24,22 @@ <% if (replys.length) { %>
- <% _.each(replys, function (item) { %> -
+ <% _.each(replys, function (item, index) { %> +
style="padding-bottom: 0;" <% } %>;>
<%=item.get("usercolor")%><% } else { %> #cfcfcf <% } %>; " >
<%= scope.getUserName(item.get("username")) %>
<%=item.get("date")%>
<% if (!item.get("editText")) { %>
<%=scope.pickLink(item.get("reply"))%>
+ <% if (!hint) { %>
<% if (item.get("editable")) { %>
">
<% } %>
">
-
+
+ <%}%> <% } else { %>
@@ -51,7 +53,7 @@ - <% if (!showReply) { %> + <% if (!showReply && !hint) { %> <% if (replys.length) { %> <% } else { %> @@ -61,7 +63,7 @@ - <% if (!editText && !lock) { %> + <% if (!editText && !lock && !hint) { %>
<% if (editable) { %>
diff --git a/apps/common/main/lib/view/Comments.js b/apps/common/main/lib/view/Comments.js index b6888f4358..df32ed3f08 100644 --- a/apps/common/main/lib/view/Comments.js +++ b/apps/common/main/lib/view/Comments.js @@ -549,6 +549,17 @@ define([ this.autoHeightTextBox(); }, + changeLayout: function(mode) { + if (!mode.canComments) { + var add = $('.new-comment-ct', this.el), + to = $('.add-link-ct', this.el), + msgs = $('.messages-ct', this.el); + add.hide(); to.hide(); + msgs.addClass('stretch'); + this.layout.changeLayout([{el: msgs[0], rely: false, stretch: true}]); + } + }, + updateLayout: function () { var container = $('#comments-box', this.el), add = $('.new-comment-ct', this.el); if (add.css('display') !== 'none') { @@ -561,6 +572,7 @@ define([ autoHeightTextBox: function () { var me = this, domTextBox = null, lineHeight = 0, minHeight = 44; var textBox = $('#comment-msg-new', this.el); + if (textBox.length<1) return; function updateTextBoxHeight() { diff --git a/apps/common/main/resources/less/comments.less b/apps/common/main/resources/less/comments.less index c69d64f405..7ca42c406f 100644 --- a/apps/common/main/resources/less/comments.less +++ b/apps/common/main/resources/less/comments.less @@ -16,6 +16,10 @@ height: 300px; border-bottom: 1px solid @gray-dark; + &.stretch { + border-bottom: none; + } + .ps-scrollbar-y-rail { margin-top: 5px; margin-bottom: 5px; diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index e6b0a30184..07dd0f3f8d 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -188,8 +188,8 @@ define([ createDelayedElements: function() { /** coauthoring begin **/ if ( this.mode.canCoAuthoring ) { - this.leftMenu.btnComments[(this.mode.canComments && !this.mode.isLightVersion) ? 'show' : 'hide'](); - if (this.mode.canComments) + this.leftMenu.btnComments[(this.mode.canViewComments && !this.mode.isLightVersion) ? 'show' : 'hide'](); + if (this.mode.canViewComments) this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView()); this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide'](); @@ -406,7 +406,7 @@ define([ Common.Utils.InternalSettings.set("de-settings-livecomment", value); var resolved = Common.localStorage.getBool("de-settings-resolvedcomment"); Common.Utils.InternalSettings.set("de-settings-resolvedcomment", resolved); - if (this.mode.canComments && this.leftMenu.panelComments.isVisible()) + if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible()) value = resolved = true; (value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments(); /** coauthoring end **/ @@ -653,7 +653,7 @@ define([ if (value && this.leftMenu._state.pluginIsRunning) { this.leftMenu.panelPlugins.show(); if (this.mode.canCoAuthoring) { - this.mode.canComments && this.leftMenu.panelComments['hide'](); + this.mode.canViewComments && this.leftMenu.panelComments['hide'](); this.mode.canChat && this.leftMenu.panelChat['hide'](); } } @@ -751,7 +751,7 @@ define([ } return false; case 'comments': - if (this.mode.canCoAuthoring && this.mode.canComments && !this.mode.isLightVersion) { + if (this.mode.canCoAuthoring && this.mode.canViewComments && !this.mode.isLightVersion) { Common.UI.Menu.Manager.hideAll(); this.leftMenu.showMenu('comments'); this.getApplication().getController('Common.Controllers.Comments').onAfterShow(); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index e5f8ba57c2..97bff0187a 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1112,6 +1112,7 @@ define([ this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring; this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view'); this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); + this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit; this.appOptions.canPrint = (this.permissions.print !== false); @@ -1204,12 +1205,11 @@ define([ }, applyModeEditorElements: function() { - if (this.appOptions.canComments || this.appOptions.isEdit) { - /** coauthoring begin **/ - this.contComments.setMode(this.appOptions); - this.contComments.setConfig({config: this.editorConfig}, this.api); - /** coauthoring end **/ - } + /** coauthoring begin **/ + this.contComments.setMode(this.appOptions); + this.contComments.setConfig({config: this.editorConfig}, this.api); + /** coauthoring end **/ + if (this.appOptions.isEdit) { var me = this, application = this.getApplication(), diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 9fd2cdb090..a6d4296452 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -401,7 +401,7 @@ define([ /** coauthoring begin **/ $('tr.coauth', this.el)[mode.isEdit && mode.canCoAuthoring ? 'show' : 'hide'](); $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide'](); - $('tr.comments', this.el)[mode.canCoAuthoring && (mode.isEdit || mode.canComments) ? 'show' : 'hide'](); + $('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide'](); /** coauthoring end **/ }, diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index 5e53e9ab5d..1e810dfee1 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -216,7 +216,7 @@ define([ onCoauthOptions: function(e) { /** coauthoring begin **/ if (this.mode.canCoAuthoring) { - if (this.mode.canComments) { + if (this.mode.canViewComments) { if (this.btnComments.pressed && this.btnComments.$el.hasClass('notify')) this.btnComments.$el.removeClass('notify'); this.panelComments[this.btnComments.pressed?'show':'hide'](); @@ -288,7 +288,7 @@ define([ this.$el.width(SCALE_MIN); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { - if (this.mode.canComments) { + if (this.mode.canViewComments) { this.panelComments['hide'](); if (this.btnComments.pressed) this.fireEvent('comments:hide', this); diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index fad0ff918d..e21d19dd1c 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -182,8 +182,8 @@ define([ createDelayedElements: function() { /** coauthoring begin **/ if ( this.mode.canCoAuthoring ) { - this.leftMenu.btnComments[(this.mode.canComments && !this.mode.isLightVersion) ? 'show' : 'hide'](); - if (this.mode.canComments) + this.leftMenu.btnComments[(this.mode.canViewComments && !this.mode.isLightVersion) ? 'show' : 'hide'](); + if (this.mode.canViewComments) this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments')); this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide'](); @@ -631,7 +631,7 @@ define([ } return false; case 'comments': - if (this.mode.canCoAuthoring && this.mode.canComments && !this.mode.isLightVersion && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) { + if (this.mode.canCoAuthoring && this.mode.canViewComments && !this.mode.isLightVersion && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) { Common.UI.Menu.Manager.hideAll(); this.leftMenu.showMenu('comments'); this.getApplication().getController('Common.Controllers.Comments').onAfterShow(); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index b0ac25ed6d..e16ee8f012 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -876,6 +876,7 @@ define([ this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable(); this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view'); this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); + this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); this.appOptions.canPrint = (this.permissions.print !== false); this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename; @@ -940,15 +941,13 @@ define([ }, applyModeEditorElements: function(prevmode) { - if (this.appOptions.canComments || this.appOptions.isEdit) { - /** coauthoring begin **/ - var commentsController = this.getApplication().getController('Common.Controllers.Comments'); - if (commentsController) { - commentsController.setMode(this.appOptions); - commentsController.setConfig({config: this.editorConfig, sdkviewname: '#id_main_parent'}, this.api); - } - /** coauthoring end **/ + /** coauthoring begin **/ + var commentsController = this.getApplication().getController('Common.Controllers.Comments'); + if (commentsController) { + commentsController.setMode(this.appOptions); + commentsController.setConfig({config: this.editorConfig, sdkviewname: '#id_main_parent'}, this.api); } + /** coauthoring end **/ if (this.appOptions.isEdit) { var me = this, application = this.getApplication(), diff --git a/apps/presentationeditor/main/app/view/LeftMenu.js b/apps/presentationeditor/main/app/view/LeftMenu.js index c85945d254..e7b1eaca2a 100644 --- a/apps/presentationeditor/main/app/view/LeftMenu.js +++ b/apps/presentationeditor/main/app/view/LeftMenu.js @@ -218,7 +218,7 @@ define([ onCoauthOptions: function(e) { /** coauthoring begin **/ if (this.mode.canCoAuthoring) { - if (this.mode.canComments) { + if (this.mode.canViewComments) { if (this.btnComments.pressed && this.btnComments.$el.hasClass('notify')) this.btnComments.$el.removeClass('notify'); this.panelComments[this.btnComments.pressed?'show':'hide'](); @@ -274,7 +274,7 @@ define([ this.$el.width(SCALE_MIN); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { - if (this.mode.canComments) { + if (this.mode.canViewComments) { this.panelComments['hide'](); if (this.btnComments.pressed) this.fireEvent('comments:hide', this); diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 99b81167f2..373bdc9900 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -980,7 +980,7 @@ define([ } } - if (me.permissions.isEdit || me.permissions.canComments) { + if (me.permissions.isEdit || me.permissions.canViewComments) { if (index_comments && !this.popupmenu) { data = dataarray[index_comments - 1]; if (!commentTip.editCommentId && commentTip.moveCommentId != data.asc_getCommentIndexes()[0]) { @@ -1015,7 +1015,7 @@ define([ var commentsController = this.getApplication().getController('Common.Controllers.Comments'); if (commentsController) { - if (this.permissions.canCoAuthoring && this.permissions.canComments) + if (this.permissions.canCoAuthoring && this.permissions.canViewComments) setTimeout(function() {commentsController.onApiHideComment(true);}, 200); else commentsController.onApiHideComment(true); diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index fc6fa33022..58e8ebb4b8 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -189,8 +189,8 @@ define([ createDelayedElements: function() { /** coauthoring begin **/ if ( this.mode.canCoAuthoring ) { - this.leftMenu.btnComments[(this.mode.canComments && !this.mode.isLightVersion) ? 'show' : 'hide'](); - if (this.mode.canComments) + this.leftMenu.btnComments[(this.mode.canViewComments && !this.mode.isLightVersion) ? 'show' : 'hide'](); + if (this.mode.canViewComments) this.leftMenu.setOptionsPanel('comment', this.getApplication().getController('Common.Controllers.Comments').getView('Common.Views.Comments')); this.leftMenu.btnChat[(this.mode.canChat && !this.mode.isLightVersion) ? 'show' : 'hide'](); @@ -349,7 +349,7 @@ define([ var resolved = Common.localStorage.getBool("sse-settings-resolvedcomment"); Common.Utils.InternalSettings.set("sse-settings-resolvedcomment", resolved); - if (this.mode.canComments && this.leftMenu.panelComments.isVisible()) + if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible()) value = resolved = true; (value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments(); @@ -713,7 +713,7 @@ define([ if (!state && this.leftMenu._state.pluginIsRunning) { this.leftMenu.panelPlugins.show(); if (this.mode.canCoAuthoring) { - this.mode.canComments && this.leftMenu.panelComments['hide'](); + this.mode.canViewComments && this.leftMenu.panelComments['hide'](); this.mode.canChat && this.leftMenu.panelChat['hide'](); } } @@ -818,7 +818,7 @@ define([ } return false; case 'comments': - if (this.mode.canCoAuthoring && this.mode.canComments && !this.mode.isLightVersion) { + if (this.mode.canCoAuthoring && this.mode.canViewComments && !this.mode.isLightVersion) { Common.UI.Menu.Manager.hideAll(); this.leftMenu.showMenu('comments'); this.getApplication().getController('Common.Controllers.Comments').onAfterShow(); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 6970308aab..df955255c2 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -902,6 +902,7 @@ define([ /** coauthoring end **/ this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? (this.permissions.edit !== false) : this.permissions.comment) && (this.editorConfig.mode !== 'view'); this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); + this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename; this.appOptions.trialMode = params.asc_getLicenseMode(); @@ -1001,19 +1002,17 @@ define([ }, applyModeEditorElements: function(prevmode) { - if (this.appOptions.canComments || this.appOptions.isEdit) { - /** coauthoring begin **/ - var commentsController = this.getApplication().getController('Common.Controllers.Comments'); - if (commentsController) { - commentsController.setMode(this.appOptions); - commentsController.setConfig({ - config : this.editorConfig, - sdkviewname : '#ws-canvas-outer', - hintmode : true}, - this.api); - } - /** coauthoring end **/ + /** coauthoring begin **/ + var commentsController = this.getApplication().getController('Common.Controllers.Comments'); + if (commentsController) { + commentsController.setMode(this.appOptions); + commentsController.setConfig({ + config : this.editorConfig, + sdkviewname : '#ws-canvas-outer', + hintmode : true}, + this.api); } + /** coauthoring end **/ if (this.appOptions.isEdit) { var me = this, @@ -1623,7 +1622,7 @@ define([ if (!this.appOptions.isEditMailMerge && !this.appOptions.isEditDiagram && window.editor_elements_prepared) { this.application.getController('Statusbar').selectTab(index); - if (this.appOptions.canComments && !this.dontCloseDummyComment) { + if (this.appOptions.canViewComments && !this.dontCloseDummyComment) { Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getWorksheetId(index)], false ); // hide popover } } diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index cb75775765..c11882be1c 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -267,9 +267,9 @@ define([ me.header.mnuitemFreezePanes.hide(); menu.items[5].hide(); menu.items[7].hide(); - if (!config.canComments) { // show advanced settings for editing and commenting mode - mnuitemAdvSettings.hide(); - menu.items[9].hide(); + if (!config.canViewComments) { // show advanced settings for editing and commenting mode + // mnuitemAdvSettings.hide(); + // menu.items[9].hide(); } } diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 4008bf2c68..135a2f2d34 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -255,8 +255,8 @@ define([ this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 || this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length))?'show':'hide'](); - this.miSettings[(this.mode.isEdit || this.mode.canComments)?'show':'hide'](); - this.miSettings.$el.prev()[(this.mode.isEdit || this.mode.canComments)?'show':'hide'](); + // this.miSettings[(this.mode.isEdit || this.mode.canViewComments)?'show':'hide'](); + // this.miSettings.$el.prev()[(this.mode.isEdit || this.mode.canViewComments)?'show':'hide'](); this.mode.canBack ? this.$el.find('#fm-btn-back').show().prev().show() : this.$el.find('#fm-btn-back').hide().prev().hide(); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index af8809b028..3bdbc51311 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -746,7 +746,7 @@ define([ this.lblAutosave.text(this.textAutoRecover); } $('tr.forcesave', this.el)[mode.canForcesave ? 'show' : 'hide'](); - $('tr.comments', this.el)[mode.canCoAuthoring && (mode.isEdit || mode.canComments) ? 'show' : 'hide'](); + $('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide'](); $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring? 'show' : 'hide'](); }, diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index 46ee90b8b4..fa2fff5b5e 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -193,7 +193,7 @@ define([ /** coauthoring begin **/ onCoauthOptions: function(e) { if (this.mode.canCoAuthoring) { - if (this.mode.canComments) { + if (this.mode.canViewComments) { if (this.btnComments.pressed && this.btnComments.$el.hasClass('notify')) this.btnComments.$el.removeClass('notify'); this.panelComments[this.btnComments.pressed?'show':'hide'](); @@ -247,7 +247,7 @@ define([ this.$el.width(SCALE_MIN); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { - if (this.mode.canComments) { + if (this.mode.canViewComments) { this.panelComments['hide'](); if (this.btnComments.pressed) this.fireEvent('comments:hide', this);