mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
refactor toggleGrid to be clearer, only send analytics in response to user action
This commit is contained in:
parent
caa7aed291
commit
2762cdf271
1 changed files with 5 additions and 5 deletions
|
@ -729,7 +729,7 @@ export default class UI {
|
||||||
UI.creatTopBarClicky(div, 'go', 'go on', UI.toggleRun);
|
UI.creatTopBarClicky(div, 'go', 'go on', UI.toggleRun);
|
||||||
UI.creatTopBarClicky(div, 'resetall', 'resetall', UI.resetAllSprites);
|
UI.creatTopBarClicky(div, 'resetall', 'resetall', UI.resetAllSprites);
|
||||||
UI.creatTopBarClicky(div, 'full', 'fullscreen', ScratchJr.fullScreen);
|
UI.creatTopBarClicky(div, 'full', 'fullscreen', ScratchJr.fullScreen);
|
||||||
UI.toggleGrid(true);
|
UI.setShowGrid(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static resetAllSprites (e) {
|
static resetAllSprites (e) {
|
||||||
|
@ -756,12 +756,12 @@ export default class UI {
|
||||||
|
|
||||||
static switchGrid () {
|
static switchGrid () {
|
||||||
ScratchAudio.sndFX('tap.wav');
|
ScratchAudio.sndFX('tap.wav');
|
||||||
UI.toggleGrid(!Grid.hidden);
|
UI.setShowGrid(Grid.hidden);
|
||||||
|
iOS.analyticsEvent('editor', Grid.hidden ? 'hide_grid' : 'show_grid');
|
||||||
}
|
}
|
||||||
|
|
||||||
static toggleGrid (b) {
|
static setShowGrid (b) {
|
||||||
Grid.hide(b);
|
Grid.hide(!b);
|
||||||
iOS.analyticsEvent('editor', Grid.hidden ? 'hide_grid' : 'show_grid');
|
|
||||||
gn('grid').className = Grid.hidden ? 'gridToggle off' : 'gridToggle on';
|
gn('grid').className = Grid.hidden ? 'gridToggle off' : 'gridToggle on';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue