Skip to content

Commit

Permalink
Merge branch 'pr/1601' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Laské committed Apr 18, 2024
2 parents 42cacf0 + 67d05cd commit 89514cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Extra icon rendering in QRCode activity #1193
- Message Updation in Fraction Activity #1453
- LabyrinthJS: No selection-indicator is visible while linking ideas #1585
- Gear unexpected behavior of Play toolbar icon #1600

## [1.8.0] - 2024-04-10
### Added
Expand Down
17 changes: 11 additions & 6 deletions activities/Gears.activity/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@ define(["sugar-web/activity/activity","sugar-web/graphics/radiobuttonsgroup","ge
gearSketch.selectButton = function (buttonName) {
return this.selectedButton = buttonName;
}

function UISwitch(before, after){
playButton.classList.remove(before);
playButton.classList.add(after);
}
// Gear button.
gearButton.addEventListener('click', function (event) {
if (gearSketch.isDemoPlaying) {
gearSketch.stopDemo();
}
UISwitch('pause', 'play');
gearSketch.selectButton("gearButton");
});

Expand All @@ -69,6 +73,7 @@ define(["sugar-web/activity/activity","sugar-web/graphics/radiobuttonsgroup","ge
if (gearSketch.isDemoPlaying) {
gearSketch.stopDemo();
}
UISwitch('pause', 'play');
gearSketch.selectButton("chainButton");
});

Expand All @@ -77,6 +82,7 @@ define(["sugar-web/activity/activity","sugar-web/graphics/radiobuttonsgroup","ge
if (gearSketch.isDemoPlaying) {
gearSketch.stopDemo();
}
UISwitch('pause', 'play');
gearSketch.selectButton("momentumButton");
});

Expand All @@ -87,13 +93,11 @@ define(["sugar-web/activity/activity","sugar-web/graphics/radiobuttonsgroup","ge
}
if(gearSketch.selectedButton == "playButton"){
gearSketch.selectButton(null);
playButton.classList.remove('pause');
playButton.classList.add('play');
UISwitch('pause', 'play');
}
else{
gearSketch.selectButton("playButton");
playButton.classList.remove('play');
playButton.classList.add('pause');
UISwitch('play', 'pause');
}
});

Expand All @@ -108,6 +112,7 @@ define(["sugar-web/activity/activity","sugar-web/graphics/radiobuttonsgroup","ge
gearSketch.stopDemo();
return;
}
UISwitch('pause', 'play');
gearSketch.board.clear();
});

Expand All @@ -120,7 +125,7 @@ define(["sugar-web/activity/activity","sugar-web/graphics/radiobuttonsgroup","ge
}
gearSketch.playDemo();
});

// Full screen.
document.getElementById("fullscreen-button").addEventListener('click', function() {
document.getElementById("main-toolbar").style.opacity = 0;
Expand Down

0 comments on commit 89514cc

Please sign in to comment.