From 2360c3362934581ae98aa65759987cf1b56dc88b Mon Sep 17 00:00:00 2001 From: muxator Date: Sat, 28 Mar 2020 22:02:49 +0100 Subject: [PATCH] toolbar: formatting, no functional changes. In preparation for the next commits by John. --- src/node/utils/toolbar.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/node/utils/toolbar.js b/src/node/utils/toolbar.js index f2dfbb35..429aac16 100644 --- a/src/node/utils/toolbar.js +++ b/src/node/utils/toolbar.js @@ -250,27 +250,28 @@ module.exports = { selectButton: function (attributes) { return new SelectButton(attributes); }, + menu: function (buttons, isReadOnly) { - if(isReadOnly){ + if (isReadOnly) { // The best way to detect if it's the left editbar is to check for a bold button - if(buttons[0].indexOf("bold") !== -1){ + if (buttons[0].indexOf("bold") !== -1) { // Clear all formatting buttons - buttons = [] - }else{ + buttons = []; + } else { // Remove Save Revision from the right menu removeItem(buttons[0],"savedrevision"); } - }else{ - /* This pad is not read only + } else { + /* + * This pad is not read only * - * Readd the savedrevision button (the "star") if is not already there. + * Add back the savedrevision button (the "star") if is not already there. * * This is a quick fix for #3702: it was sufficient to visit a single read * only pad to cause the disappearence of the star button from all the * pads. */ - if(buttons[0].indexOf("savedrevision") === -1){ - // Add item back in for savedrevision + if ((buttons[0].indexOf("savedrevision") === -1)) { buttons[0].push("savedrevision"); } }