Merge pull request #2739 from ONLYOFFICE/feature/chat-header

Chat header
This commit is contained in:
Julia Radzhabova
2023-12-13 17:24:08 +03:00
committed by GitHub
8 changed files with 66 additions and 7 deletions

View File

@ -11,4 +11,8 @@
<button id="chat-msg-btn-add" class="btn normal dlg-btn primary" data-hint="1" data-hint-direction="bottom" data-hint-offset="big"><%=scope.textSend%></button>
</div>
</div>
<div id="chat-header" class="">
<label><%=textChat%></label>
<div id="chat-btn-close" class="float-right margin-left-4"></div>
</div>
</div>

View File

@ -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 || {}))
});

View File

@ -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;

View File

@ -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);
}
}
}
},

View File

@ -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",

View File

@ -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);
}
}
}
},

View File

@ -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);
}
}
},

View File

@ -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);
}
}
},