Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature expand chat panel width by clicking on title #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ see https://openmeetings.apache.org/LanguageEditor.html for Details
please check <tt>openmeetings.log</tt> and contact OpenMeetings developers]]></entry>
<entry key="invalid.hash"><![CDATA[Invalid hash]]></entry>
<entry key="label.dock.panel"><![CDATA[Click to dock panel]]></entry>
<entry key="label.exdock.panel"><![CDATA[Click to expand dock panel]]></entry>
<entry key="label.undock.panel"><![CDATA[Click to undock panel]]></entry>
<entry key="lbl.cancel"><![CDATA[Cancel]]></entry>
<entry key="lbl.email"><![CDATA[Email]]></entry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<html xmlns:wicket="http://wicket.apache.org">
<wicket:panel>
<div id="chatPopup" class="bg-light">
<div class="control block clickable bg-secondary" wicket:message="data-ttl-dock:label.dock.panel,data-ttl-undock:label.undock.panel">
<div class="control block clickable bg-secondary" wicket:message="data-ttl-dock:label.dock.panel,data-ttl-undock:label.undock.panel,data-ttl-exdock:label.exdock.panel">
<i class="fas ml-1"></i>
<div class="label"><wicket:message key="244"/></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ var Chat = function() {
function isClosed() {
return p.hasClass('closed');
}
function isWide() {
return p.hasClass('wide');
}
function activateTab(id) {
if (isClosed()) {
if (isClosed() || isWide()) {
tabs.find('.nav.nav-tabs .nav-link').each(function() {
const self = $(this)
, tabId = self.attr('aria-controls')
Expand Down Expand Up @@ -353,11 +356,51 @@ var Chat = function() {
}
});
}
function _setOpenedw() {
__setCssWidth(innerWidth);
p.addClass('wide').css({'height': '', 'width': ''});
p.resizable({
handles: (Settings.isRtl ? 'e' : 'w')
, minWidth: 120
, stop: function(event, ui) {
p.css({'left': '', 'width': '', 'height': ''});
openedWidth = ui.size.width + 'px';
__setCssWidth(openedWidth);
}
});
}
function _removeResize() {
if (p.resizable('instance') !== undefined) {
p.resizable('destroy');
}
}
function _openw(handler) {
if (!isClosed() && !isWide()) {
//ctrl.removeClass('bg-warning');
let opts;
if (roomMode) {
opts = {width: innerWidth};
} else {
opts = {height: openedHeight};
p.resizable("option", "disabled", false);
}
p.removeClass('closed').animate(opts, 1000, function() {
__hideActions();
p.removeClass('closed');
p.css({'height': '', 'width': ''});
if (typeof(handler) === 'function') {
handler();
}
ctrl.attr('title', ctrl.data('ttl-undock'));
if (roomMode) {
_setOpenedw();
} else {
__setCssHeight(openedHeight);
}
_setAreaHeight();
});
}
}
function _open(handler) {
if (isClosed()) {
ctrl.removeClass('bg-warning');
Expand All @@ -375,7 +418,7 @@ var Chat = function() {
if (typeof(handler) === 'function') {
handler();
}
ctrl.attr('title', ctrl.data('ttl-undock'));
ctrl.attr('title', ctrl.data('ttl-exdock'));
if (roomMode) {
_setOpened();
} else {
Expand All @@ -396,6 +439,7 @@ var Chat = function() {
}
p.animate(opts, 1000, function() {
p.addClass('closed').css({'height': '', 'width': ''});
p.removeClass('wide');
if (roomMode) {
__setCssWidth(closedSizePx);
_removeResize();
Expand All @@ -412,8 +456,10 @@ var Chat = function() {
function _toggle() {
if (isClosed()) {
_open();
} else {
} else if (isWide()) {
_close();
} else {
_openw();
}
}
function _editorAppend(emoticon) {
Expand Down
8 changes: 7 additions & 1 deletion openmeetings-web/src/main/webapp/css/raw-chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@
content: "\f106";
}
.main.room #chatPanel #chatPopup .control.block i::before {
content: "\f105";
content: "\f104\f104";
}
.main.room #chatPanel.closed #chatPopup .control.block i::before {
content: "\f104";
}
.main.room #chatPanel.wide #chatPopup .control.block i::before {
content: "\f105";
}
.main.room #chatPanel.opened #chatPopup .control.block i::before {
content: "\f104";
}
#chat .messageArea .msg-row.need-moderation {
background-color: var(--warning);
}
Expand Down