diff --git a/apps/common/main/lib/template/Chat.template b/apps/common/main/lib/template/Chat.template index 5836bc8ab5..341869ffc7 100644 --- a/apps/common/main/lib/template/Chat.template +++ b/apps/common/main/lib/template/Chat.template @@ -11,4 +11,8 @@ +
+ +
+
\ No newline at end of file diff --git a/apps/common/main/lib/view/Chat.js b/apps/common/main/lib/view/Chat.js index 5189b2debf..42981b589e 100644 --- a/apps/common/main/lib/view/Chat.js +++ b/apps/common/main/lib/view/Chat.js @@ -98,7 +98,7 @@ define([ events: { }, - usersBoxHeight: 72, + usersBoxHeight: 117, messageBoxHeight: 70, addMessageBoxHeight: 110, @@ -120,7 +120,7 @@ define([ render: function(el) { el = el || this.el; - $(el).html(this.template({scope: this, maxMsgLength: Asc.c_oAscMaxCellOrCommentLength})); + $(el).html(this.template({scope: this, maxMsgLength: Asc.c_oAscMaxCellOrCommentLength, textChat: this.textChat })); this.panelBox = $('#chat-box', this.el); this.panelUsers = $('#chat-users', this.el); @@ -141,6 +141,14 @@ define([ }); this.panelOptions.scroller = new Common.UI.Scroller({el: $('#chat-options')}); + this.buttonClose = new Common.UI.Button({ + parentEl: $('#chat-btn-close', this.$el), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-close', + hint: this.textClosePanel + }); + this.buttonClose.on('click', _.bind(this.onClickClosePanel, this)); + $('#chat-msg-btn-add', this.el).on('click', _.bind(this._onBtnAddMessage, this)); this.txtMessage.on('keydown', _.bind(this._onKeyDown, this)); @@ -306,7 +314,7 @@ define([ return me.usersBoxHeight; }), fmax: (function () { - return me.panelBox.height() * 0.5 - me.messageBoxHeight; + return Math.max(me.usersBoxHeight-20,me.panelBox.height() * 0.5 - me.messageBoxHeight); }) }}, {el: items[1], rely: true, behaviour: 'splitter', @@ -445,7 +453,13 @@ define([ } }, - textSend: "Send" + onClickClosePanel: function() { + Common.NotificationCenter.trigger('leftmenu:change', 'hide'); + }, + + textSend: "Send", + textChat: "Chat", + textClosePanel: "Close chat" }, Common.Views.Chat || {})) }); \ No newline at end of file diff --git a/apps/common/main/resources/less/chat.less b/apps/common/main/resources/less/chat.less index 1a8cf629d1..3f6a1d344c 100644 --- a/apps/common/main/resources/less/chat.less +++ b/apps/common/main/resources/less/chat.less @@ -9,6 +9,26 @@ display: table-row; } + #chat-header { + position: absolute; + height: 45px; + left: 0; + top: 0; + right: 0; + padding: 12px; + overflow: hidden; + border-bottom: @scaled-one-px-value-ie solid @border-toolbar-ie; + border-bottom: @scaled-one-px-value solid @border-toolbar; + background-color: @background-toolbar-ie; + background-color: @background-toolbar; + + label { + .font-size-medium(); + .font-weight-bold(); + margin-top: 2px; + } + } + .area { position: absolute; border-bottom: 1px solid @border-toolbar-ie; @@ -38,9 +58,12 @@ left: 0; top: 0; right: 0; - height: 70px; - padding: 5px 0; - + height: 125px; + padding-bottom: 5px; + padding-top: 50px; + .ps-scrollbar-y-rail { + margin-top: 50px; + } ul { margin: 0; padding: 0; diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index fd51712442..bc6d60bafe 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -772,6 +772,10 @@ define([ this.leftMenu.panelNavigation.hide(); this.leftMenu.onBtnMenuClick(this.leftMenu.btnNavigation); } + else if (this.leftMenu.btnChat.isActive()) { + this.leftMenu.btnChat.toggle(false); + this.leftMenu.onBtnMenuClick(this.leftMenu.btnChat); + } } } }, diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 00462c61bf..26d78c031c 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -463,6 +463,8 @@ "Common.Views.AutoCorrectDialog.warnReplace": "The autocorrect entry for %1 already exists. Do you want to replace it?", "Common.Views.AutoCorrectDialog.warnReset": "Any autocorrect you added will be removed and the changed ones will be restored to their original values. Do you want to continue?", "Common.Views.AutoCorrectDialog.warnRestore": "The autocorrect entry for %1 will be reset to its original value. Do you want to continue?", + "Common.Views.Chat.textChat": "Chat", + "Common.Views.Chat.textClosePanel": "Close chat", "Common.Views.Chat.textSend": "Send", "Common.Views.Comments.mniAuthorAsc": "Author A to Z", "Common.Views.Comments.mniAuthorDesc": "Author Z to A", diff --git a/apps/pdfeditor/main/app/controller/LeftMenu.js b/apps/pdfeditor/main/app/controller/LeftMenu.js index 54249fc99e..66352e6f9e 100644 --- a/apps/pdfeditor/main/app/controller/LeftMenu.js +++ b/apps/pdfeditor/main/app/controller/LeftMenu.js @@ -686,6 +686,10 @@ define([ this.leftMenu.panelNavigation.hide(); this.leftMenu.onBtnMenuClick(this.leftMenu.btnNavigation); } + else if (this.leftMenu.btnChat.isActive()) { + this.leftMenu.btnChat.toggle(false); + this.leftMenu.onBtnMenuClick(this.leftMenu.btnChat); + } } } }, diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index 44b3383210..fda53caa4a 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -723,6 +723,10 @@ define([ this.leftMenu.btnSearchBar.toggle(false); this.leftMenu.onBtnMenuClick(this.leftMenu.btnSearchBar); } + else if (this.leftMenu.btnChat.isActive()) { + this.leftMenu.btnChat.toggle(false); + this.leftMenu.onBtnMenuClick(this.leftMenu.btnChat); + } } }, diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 8416bc432c..7327a14b7c 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -953,6 +953,10 @@ define([ this.leftMenu.btnSpellcheck.toggle(false); this.leftMenu.onBtnMenuClick(this.leftMenu.btnSpellcheck); } + else if (this.leftMenu.btnChat.isActive()) { + this.leftMenu.btnChat.toggle(false); + this.leftMenu.onBtnMenuClick(this.leftMenu.btnChat); + } } },