mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
toolbar: don't show the "saved revision" button in timeslider
The saved revision "star" button appeared in the timeslider toolbar too. This change introduces a second flag "page" in toolbar.menu(), which controls whether the toolbar is being drawn for a pad or in the timeslider page. Fixes #3767.
This commit is contained in:
parent
0d2854571d
commit
8b2fe75867
3 changed files with 11 additions and 9 deletions
|
@ -253,8 +253,9 @@ module.exports = {
|
|||
|
||||
/*
|
||||
* Valid values for whichMenu: 'left' | 'right' | 'timeslider-right'
|
||||
* Valid values for page: 'pad' | 'timeslider'
|
||||
*/
|
||||
menu: function (buttons, isReadOnly, whichMenu) {
|
||||
menu: function (buttons, isReadOnly, whichMenu, page) {
|
||||
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) {
|
||||
|
@ -269,13 +270,14 @@ module.exports = {
|
|||
* This pad is not read only
|
||||
*
|
||||
* Add back the savedrevision button (the "star") if is not already there,
|
||||
* but only on the right toolbar.
|
||||
* but only on the right toolbar, and only if we are showing a pad (dont't
|
||||
* do it in the timeslider).
|
||||
*
|
||||
* 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.
|
||||
* This is a quick fix for #3702 (and subsequent issue #3767): 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) && (whichMenu === "right")) {
|
||||
if ((buttons[0].indexOf("savedrevision") === -1) && (whichMenu === "right") && (page === "pad")) {
|
||||
buttons[0].push("savedrevision");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue