toolbar: formatting, no functional changes.

In preparation for the next commits by John.
This commit is contained in:
muxator 2020-03-28 22:02:49 +01:00 committed by muxator
parent 4a17443a2e
commit 2360c33629

View file

@ -250,27 +250,28 @@ module.exports = {
selectButton: function (attributes) { selectButton: function (attributes) {
return new SelectButton(attributes); return new SelectButton(attributes);
}, },
menu: function (buttons, isReadOnly) { 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 // 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 // Clear all formatting buttons
buttons = [] buttons = [];
}else{ } else {
// Remove Save Revision from the right menu // Remove Save Revision from the right menu
removeItem(buttons[0],"savedrevision"); removeItem(buttons[0],"savedrevision");
} }
}else{ } else {
/* This pad is not read only /*
* 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 * 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 * only pad to cause the disappearence of the star button from all the
* pads. * pads.
*/ */
if(buttons[0].indexOf("savedrevision") === -1){ if ((buttons[0].indexOf("savedrevision") === -1)) {
// Add item back in for savedrevision
buttons[0].push("savedrevision"); buttons[0].push("savedrevision");
} }
} }