You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2017/11/14 16:21:27 UTC
openmeetings git commit: [OPENMEETINGS-1754] sidebar is made hidable
Repository: openmeetings
Updated Branches:
refs/heads/4.0.x 4b9b33db2 -> e8a3d229a
[OPENMEETINGS-1754] sidebar is made hidable
Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/e8a3d229
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/e8a3d229
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/e8a3d229
Branch: refs/heads/4.0.x
Commit: e8a3d229ad9773e12047594511184f3fb2c8ae52
Parents: 4b9b33d
Author: Maxim Solodovnik <so...@gmail.com>
Authored: Tue Nov 14 23:21:17 2017 +0700
Committer: Maxim Solodovnik <so...@gmail.com>
Committed: Tue Nov 14 23:21:17 2017 +0700
----------------------------------------------------------------------
.../web/room/activities/activities.js | 6 +-
.../org/apache/openmeetings/web/room/room.js | 69 ++++++++++++++-----
.../web/room/sidebar/RoomSidebar.html | 1 +
.../webapp/css/images/double-arrow-left.png | Bin 0 -> 531 bytes
.../webapp/css/images/double-arrow-right.png | Bin 0 -> 484 bytes
openmeetings-web/src/main/webapp/css/room.css | 15 +++-
6 files changed, 71 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/e8a3d229/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/activities.js
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/activities.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/activities.js
index 084b8c0..f7059bb 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/activities.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/activities/activities.js
@@ -4,21 +4,21 @@ var Activities = function() {
let activities, openedHeight = "345px", inited = false;
function isClosed() {
- return inited && activities.height() < 24;
+ return activities.height() < 24;
}
function open() {
if (isClosed()) {
$('.control.block .ui-icon', activities).removeClass('ui-icon-caret-1-n').addClass('ui-icon-caret-1-s');
$('.control.block', activities).removeClass('ui-state-highlight');
activities.animate({height: openedHeight}, 1000);
- activities.resizable("option", "disabled", false);
+ activities.resizable('option', 'disabled', false);
}
}
function close() {
if (!isClosed()) {
$('.control.block .ui-icon', activities).removeClass('ui-icon-caret-1-s').addClass('ui-icon-caret-1-n');
activities.animate({height: closedHeight}, 1000);
- activities.resizable("option", "disabled", false);
+ activities.resizable('option', 'disabled', true);
}
}
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/e8a3d229/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
index d7cf204..557a28f 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/room.js
@@ -560,14 +560,43 @@ var VideoManager = (function() {
return self;
})();
var Room = (function() {
- const self = {};
- let options, menuHeight, chat;
+ const self = {}, isRtl = "rtl" === $('html').attr('dir'), sbSide = isRtl ? 'right' : 'left';
+ let options, menuHeight, chat, sb, dock;
function _init(_options) {
options = _options;
window.WbArea = options.interview ? InterviewWbArea() : DrawWbArea();
const menu = $('.room.box .room.menu');
chat = $('#chatPanel');
+ sb = $('.room.sidebar').css(sbSide, '0px');
+ dock = sb.find('.btn-dock').button({
+ icon: "ui-icon icon-undock"
+ , showLabel: false
+ }).click(function() {
+ const offset = parseInt(sb.css(sbSide));
+ if (offset < 0) {
+ sb.removeClass('closed');
+ }
+ dock.button('option', 'disabled', true);
+ const props = {};
+ props[sbSide] = offset < 0 ? '0px' : (-sb.width() + 45) + 'px';
+ sb.animate(props, 1500
+ , function() {
+ dock.button('option', 'disabled', false)
+ .button('option', 'icon', 'ui-icon ' + (offset < 0 ? 'icon-undock' : 'icon-dock'));
+ if (offset < 0) {
+ dock.attr('title', dock.data('ttl-undock'));
+ _sbAddResizable();
+ } else {
+ dock.attr('title', dock.data('ttl-dock'));
+ sb.addClass('closed').resizable('destroy');
+ }
+ _setSize();
+ });
+ });
+ dock.addClass(isRtl ? 'align-left' : 'align-right').attr('title', dock.data('ttl-undock'))
+ .button('option', 'label', dock.data('ttl-undock'))
+ .button('refresh');
menuHeight = menu.length === 0 ? 0 : menu.height();
VideoManager.init();
Activities.init();
@@ -615,9 +644,15 @@ var Room = (function() {
$('#wb-rename-menu').hide();
}
}
+ function _sbWidth() {
+ if (sb === undefined) {
+ sb = $('.room.sidebar');
+ }
+ return sb === undefined ? 0 : sb.width() + parseInt(sb.css(sbSide));
+ }
function _setSize() {
- const sb = $(".room.sidebar")
- , w = $(window).width() - sb.width() - 8
+ const sbW = _sbWidth()
+ , w = $(window).width() - sbW - 8
, h = $(window).height() - menuHeight - 3
, p = sb.find('.tabs')
, holder = $('.room.holder');
@@ -625,7 +660,7 @@ var Room = (function() {
const hh = h - 5;
p.height(hh);
$(".user.list", p).height(hh - $("ul", p).height() - $(".user.header", p).height() - 5);
- if (sb.width() > 230) {
+ if (sbW > 255) {
holder.addClass('big').removeClass('small');
} else {
holder.removeClass('big').addClass('small');
@@ -633,7 +668,7 @@ var Room = (function() {
Chat.setHeight(h);
if (typeof WbArea !== 'undefined') {
const chW = chat.width();
- WbArea.resize(sb.width() + 5, chW + 5, w - chW, h);
+ WbArea.resize(sbW + 5, chW + 5, w - chW, h);
}
}
function _reload() {
@@ -662,17 +697,19 @@ var Room = (function() {
]
});
}
- function _load() {
- $(".room.sidebar")
- .ready(function() {
+ function _sbAddResizable() {
+ sb.resizable({
+ handles: isRtl ? 'w' : 'e'
+ , stop: function() {
_setSize();
- })
- .resizable({
- handles: "e"
- , stop: function() {
- _setSize();
- }
- });
+ }
+ });
+ }
+ function _load() {
+ sb.ready(function() {
+ _setSize();
+ });
+ _sbAddResizable();
$(window).on('resize.openmeetings', function() {
_setSize();
});
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/e8a3d229/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.html
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.html
index a0767c6..75de098 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.html
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/sidebar/RoomSidebar.html
@@ -32,6 +32,7 @@
<wicket:message key="245"/>
</a>
</li>
+ <div class="btn-dock" wicket:message="data-ttl-dock:label.dock.panel,data-ttl-undock:label.undock.panel"></div>
</ul>
<div id="room-sidebar-tab-users">
<div wicket:id="icons" class="user header"></div>
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/e8a3d229/openmeetings-web/src/main/webapp/css/images/double-arrow-left.png
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/webapp/css/images/double-arrow-left.png b/openmeetings-web/src/main/webapp/css/images/double-arrow-left.png
new file mode 100644
index 0000000..9684631
Binary files /dev/null and b/openmeetings-web/src/main/webapp/css/images/double-arrow-left.png differ
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/e8a3d229/openmeetings-web/src/main/webapp/css/images/double-arrow-right.png
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/webapp/css/images/double-arrow-right.png b/openmeetings-web/src/main/webapp/css/images/double-arrow-right.png
new file mode 100644
index 0000000..029ff66
Binary files /dev/null and b/openmeetings-web/src/main/webapp/css/images/double-arrow-right.png differ
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/e8a3d229/openmeetings-web/src/main/webapp/css/room.css
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/webapp/css/room.css b/openmeetings-web/src/main/webapp/css/room.css
index d142126..4d51a34 100644
--- a/openmeetings-web/src/main/webapp/css/room.css
+++ b/openmeetings-web/src/main/webapp/css/room.css
@@ -164,6 +164,19 @@
.room.sidebar .user.list .user .ui-icon.big {
background-size: 32px;
}
+.room.sidebar .icon-undock, .room.sidebar .icon-dock {
+ width: 16px;
+ height: 16px;
+}
+.room.sidebar .icon-undock {
+ background-image: url(images/double-arrow-left.png);
+}
+.room.sidebar .icon-dock {
+ background-image: url(images/double-arrow-right.png);
+}
+.room.sidebar.closed #room-sidebar-tab-users, .room.sidebar.closed #room-sidebar-tab-files {
+ display: none;
+}
.audio-activity.ui-icon {
opacity: 0.2;
background-image: url(images/speaking.png);
@@ -454,7 +467,7 @@
.room.holder.big .room.sidebar .file.tree .file.item .name
, .room.holder.big .room.sidebar .file.tree .file.item .name span
{
- width: 230px;
+ width: 255px;
}
.room.sidebar .file.tree .file.item .name span {
padding: 0;