From 6b3ae24683109365f7eec40fa2bcaa9f54eaf8dc Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 12 Mar 2017 10:38:09 +0100 Subject: [PATCH] Make sure toolbar-menu-button is always last on right side of the header --- skins/elastic/ui.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 22c0f573b..78bd4cf4e 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -216,7 +216,15 @@ function rcube_elastic_ui() var toolbar = header.children('.buttons'); if (!toolbar.length) { - toolbar = $('').appendTo(header); + var menu = $('a.toolbar-menu-button', header); + toolbar = $(''); + + if (menu.length) { + menu.before(toolbar); + } + else { + toolbar.appendTo(header); + } } content_buttons = []; @@ -542,7 +550,7 @@ function rcube_elastic_ui() // or automatically add all buttons except Save and Cancel // (example QR Code button in contact frame) - var items = [], buttons_with_popup = []; + var items = []; // convert toolbar to a popup list $('.header > .toolbar', layout.content).each(function() { @@ -550,13 +558,10 @@ function rcube_elastic_ui() toolbar.children().each(function() { var button = $(this).detach(); - - $('[data-popup]', button).each(function() { - buttons_with_popup.push(this); - }); - items.push($('
  • ').append(button)); }); + + toolbar.remove(); }); // append the new toolbar and menu button