|
|
@ -91,7 +91,6 @@ MessengerUI, Messages) {
|
|
|
|
var $file = $toolbar.find('.'+BOTTOM_LEFT_CLS);
|
|
|
|
var $file = $toolbar.find('.'+BOTTOM_LEFT_CLS);
|
|
|
|
|
|
|
|
|
|
|
|
if (!config.hideDrawer) {
|
|
|
|
if (!config.hideDrawer) {
|
|
|
|
// XXX a lot of this logic is duplicated (code, slide, here)
|
|
|
|
|
|
|
|
var $drawer = $(h('button.' + FILE_CLS, [
|
|
|
|
var $drawer = $(h('button.' + FILE_CLS, [
|
|
|
|
h('i.fa.fa-file-o'),
|
|
|
|
h('i.fa.fa-file-o'),
|
|
|
|
h('span.cp-button-name', Messages.toolbar_file)
|
|
|
|
h('span.cp-button-name', Messages.toolbar_file)
|
|
|
@ -99,30 +98,8 @@ MessengerUI, Messages) {
|
|
|
|
var $drawerContent = $('<div>', {
|
|
|
|
var $drawerContent = $('<div>', {
|
|
|
|
'class': DRAWER_CLS,
|
|
|
|
'class': DRAWER_CLS,
|
|
|
|
'tabindex': 1
|
|
|
|
'tabindex': 1
|
|
|
|
}).appendTo($drawer).hide();
|
|
|
|
}).hide();
|
|
|
|
$drawer.click(function () {
|
|
|
|
UI.createDrawer($drawer, $drawerContent);
|
|
|
|
$drawerContent.toggle();
|
|
|
|
|
|
|
|
$drawer.removeClass('cp-toolbar-button-active');
|
|
|
|
|
|
|
|
if ($drawerContent.is(':visible')) {
|
|
|
|
|
|
|
|
$drawer.addClass('cp-toolbar-button-active');
|
|
|
|
|
|
|
|
$drawerContent.focus();
|
|
|
|
|
|
|
|
var wh = $(window).height();
|
|
|
|
|
|
|
|
var topPos = $drawer[0].getBoundingClientRect().bottom;
|
|
|
|
|
|
|
|
$drawerContent.css('max-height', Math.floor(wh - topPos - 1)+'px');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
var onBlur = function (e) {
|
|
|
|
|
|
|
|
if (e.relatedTarget) {
|
|
|
|
|
|
|
|
if ($(e.relatedTarget).is('.cp-toolbar-drawer-button')) { return; }
|
|
|
|
|
|
|
|
if ($(e.relatedTarget).parents('.'+DRAWER_CLS).length) {
|
|
|
|
|
|
|
|
$(e.relatedTarget).blur(onBlur);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$drawer.removeClass('cp-toolbar-button-active');
|
|
|
|
|
|
|
|
$drawerContent.hide();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$drawerContent.blur(onBlur);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// The 'notitle' class removes the line added for the title with a small screen
|
|
|
|
// The 'notitle' class removes the line added for the title with a small screen
|
|
|
|