toolbar: the "star" button no longer disappears when visiting a read-only pad

Before this patch, visiting the read-only URL for a random pad would remove
the "Save Revision" (the "star" icon) from all the other RW pads. The only way
to make it appear again was to restart the server.

This change does not fix the underlying bug: after visiting a read only link
the "star" button would still disapper, but it is explictly reinserted via an
ad-hoc condition.

Fixes #3702
This commit is contained in:
John McLear 2020-03-15 10:52:58 +00:00 committed by muxator
parent 840b4a0988
commit b480416375

View file

@ -260,6 +260,19 @@ module.exports = {
// Remove Save Revision from the right menu
removeItem(buttons[0],"savedrevision");
}
}else{
/* This pad is not read only
*
* Readd 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
buttons[0].push("savedrevision");
}
}
var groups = _.map(buttons, function (group) {