diff --git a/js/widgets/pitchstaircase.js b/js/widgets/pitchstaircase.js index 2709436106..2f17c64d44 100644 --- a/js/widgets/pitchstaircase.js +++ b/js/widgets/pitchstaircase.js @@ -25,7 +25,6 @@ - js/logo.js logo */ - /*exported PitchStaircase */ class PitchStaircase { @@ -648,7 +647,9 @@ class PitchStaircase { }, 1000); } }; - + document.getElementsByClassName("wfbWidget")[0].style.maxHeight = + 10 * PitchStaircase.BUTTONSIZE + "px"; + document.getElementsByClassName("wfbWidget")[0].style.overflowY = "scroll"; this._musicRatio1 = widgetWindow.addInputButton("3"); widgetWindow.addDivider(); this._musicRatio2 = widgetWindow.addInputButton("2"); @@ -691,6 +692,18 @@ class PitchStaircase { this._refresh(); logo.textMsg(_("Click on a note to create a new step.")); + + widgetWindow.onmaximize = () => { + if (widgetWindow._maximized) { + document.getElementsByClassName("wfbWidget")[0].style.maxHeight = + 16 * PitchStaircase.BUTTONSIZE + "px"; + document.getElementsByClassName("wfbWidget")[0].style.overflowY = "scroll"; + } else { + document.getElementsByClassName("wfbWidget")[0].style.maxHeight = + 10 * PitchStaircase.BUTTONSIZE + "px"; + document.getElementsByClassName("wfbWidget")[0].style.overflowY = "scroll"; + } + }; } /**