implement main toolbar collapse button

pull/1/head
ansuz 3 years ago
parent 4e02c309bb
commit 18c439986c

@ -455,14 +455,26 @@ MessengerUI, Messages, Pages) {
return $container; return $container;
}; };
//Messages.collapse = Messages.admin_support_collapse;
Messages.ui_collapse = "Collapse"; // XXX
Messages.ui_expand = "Expand"; // XXX
createCollapse = function (toolbar) { createCollapse = function (toolbar) {
var $button = $(h('button', [ var icon = h('i.fa.fa-caret-up');
h('i.fa.fa-compress'), var $icon = $(icon);
h('span.cp-button-name', "COLLAPSE"), // XXX var text = h('span', Messages.ui_collapse);
var $text = $(text);
var $button = $(h('button.cp-toolbar-collapse', [
icon,
h('span.cp-button-name', text),
])); ]));
toolbar.$bottomR.append($button); toolbar.$bottomR.prepend($button);
$button.click(function () { $button.click(function () {
toolbar.$top.toggleClass('toolbar-hidden'); toolbar.$top.toggleClass('toolbar-hidden');
var hidden = toolbar.$top.hasClass('toolbar-hidden');
$icon.toggleClass('fa-caret-down fa-caret-up'); //.toggleClass('fa-caret-up');
$button.toggleClass('cp-toolbar-button-active');
$text.text(Messages[(hidden ? 'ui_expand': 'ui_collapse')]);
}); });
}; };
@ -1341,7 +1353,7 @@ MessengerUI, Messages, Pages) {
// Create the subelements // Create the subelements
var tb = {}; var tb = {};
tb['userlist'] = createUserList; tb['userlist'] = createUserList;
tb['collapse'] = createCollapse; // XXX tb['collapse'] = createCollapse;
tb['chat'] = createChat; tb['chat'] = createChat;
tb['share'] = createShare; tb['share'] = createShare;
tb['access'] = createAccess; tb['access'] = createAccess;
@ -1363,8 +1375,9 @@ MessengerUI, Messages, Pages) {
tb['pad'] = function () { tb['pad'] = function () {
toolbar.$file.show(); toolbar.$file.show();
addElement([ addElement([
'chat',
'collapse', // XXX 'collapse', // XXX
'chat', 'userlist', 'title', 'useradmin', 'spinner', 'userlist', 'title', 'useradmin', 'spinner',
'newpad', 'share', 'access', 'limit', 'unpinnedWarning', 'newpad', 'share', 'access', 'limit', 'unpinnedWarning',
'notifications' 'notifications'
], {}); ], {});

Loading…
Cancel
Save