Temporarily disable the Spread mode buttons when horizontal scrolling is enabled

Given that the non-default Spread modes (currently) doesn't affect the page layout when horizontal scrolling is enabled, having the Spread buttons appear active when clicking them appears to do *nothing* is probably confusing rather than helpful to users.
This commit is contained in:
Jonas Jenwald 2018-07-08 10:56:06 +02:00
parent 36d6255866
commit d8c2bcc93a

View File

@ -221,6 +221,13 @@ class SecondaryToolbar {
buttons.scrollWrappedButton.classList.add('toggled');
break;
}
// Temporarily *disable* the Spread buttons when horizontal scrolling is
// enabled, since the non-default Spread modes doesn't affect the layout.
const isScrollModeHorizontal = (evt.mode === ScrollMode.HORIZONTAL);
buttons.spreadNoneButton.disabled = isScrollModeHorizontal;
buttons.spreadOddButton.disabled = isScrollModeHorizontal;
buttons.spreadEvenButton.disabled = isScrollModeHorizontal;
}
this.eventBus.on('scrollmodechanged', scrollModeChanged);