Skip to content

Commit

Permalink
Bug Fix: Pitch Staircase Widget (#2854)
Browse files Browse the repository at this point in the history
* Add scroll to pitch staircase widget

* Fix maximizing action

* Prettify code
  • Loading branch information
daksh4469 authored Feb 22, 2021
1 parent a7fcbad commit e034f59
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions js/widgets/pitchstaircase.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
- js/logo.js
logo
*/

/*exported PitchStaircase */

class PitchStaircase {
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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";
}
};
}

/**
Expand Down

0 comments on commit e034f59

Please sign in to comment.