diff --git a/www/pad/main.js b/www/pad/main.js index 86eb52449..34a587afa 100644 --- a/www/pad/main.js +++ b/www/pad/main.js @@ -620,6 +620,23 @@ define([ } + // Expand / collapse the toolbar + var $existingButton = $bar.find('#cke_1_toolbar_collapser'); + var $collapse = Cryptpad.createButton(null, true); + $existingButton.hide(); + $collapse.removeClass('fa-question'); + var updateIcon = function () { + $collapse.removeClass('fa-caret-down').removeClass('fa-caret-up'); + var isCollapsed = !$bar.find('.cke_toolbox_main').is(':visible'); + if (isCollapsed) { $collapse.addClass('fa-caret-down') } + else { $collapse.addClass('fa-caret-up') } + }; + updateIcon(); + $collapse.click(function () { + $existingButton.click(); + updateIcon(); + }); + $rightside.append($collapse); /* add an export button */ var $export = Cryptpad.createButton('export', true, {}, exportFile);