Skip to content

Commit

Permalink
BugFix: Phrase Maker - play stop button
Browse files Browse the repository at this point in the history
  • Loading branch information
ksraj123 authored and meganindya committed Jan 20, 2021
1 parent a90a12e commit 80da1d2
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion js/widgets/phrasemaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,35 @@ class PhraseMaker {
widgetWindow.destroy();
};

widgetWindow.addButton("play-button.svg", PhraseMaker.ICONSIZE, _("Play")).onclick = () => {
this._playButton = widgetWindow.addButton("play-button.svg", PhraseMaker.ICONSIZE, _("Play"));

this._playButton.onclick = () => {
logo.turtleDelay = 0;

logo.resetSynth(0);
if(this.playingNow) {
this._playButton.innerHTML =
'&nbsp;&nbsp;<img src="header-icons/play-button.svg" title="' +
_("Play") +
'" alt="' +
_("Play") +
'" height="' +
PhraseMaker.ICONSIZE +
'" width="' +
PhraseMaker.ICONSIZE +
'" vertical-align="middle">&nbsp;&nbsp;';
} else {
this._playButton.innerHTML =
'&nbsp;&nbsp;<img src="header-icons/stop-button.svg" title="' +
_("Stop") +
'" alt="' +
_("Stop") +
'" height="' +
PhraseMaker.ICONSIZE +
'" width="' +
PhraseMaker.ICONSIZE +
'" vertical-align="middle">&nbsp;&nbsp;';
}
this.playAll();
};

Expand Down Expand Up @@ -3887,6 +3912,16 @@ class PhraseMaker {
_("Play")
);
this.playingNow = false;
this._playButton.innerHTML =
'&nbsp;&nbsp;<img src="header-icons/play-button.svg" title="' +
_("Play") +
'" alt="' +
_("Play") +
'" height="' +
PhraseMaker.ICONSIZE +
'" width="' +
PhraseMaker.ICONSIZE +
'" vertical-align="middle">&nbsp;&nbsp;';
} else {
row = this._noteValueRow;
cell = row.cells[this._colIndex];
Expand Down

0 comments on commit 80da1d2

Please sign in to comment.