mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-25 00:28:20 -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, 'resetall', 'resetall', UI.resetAllSprites);
|
||||
UI.creatTopBarClicky(div, 'full', 'fullscreen', ScratchJr.fullScreen);
|
||||
UI.toggleGrid(true);
|
||||
UI.setShowGrid(false);
|
||||
}
|
||||
|
||||
static resetAllSprites (e) {
|
||||
|
@ -756,12 +756,12 @@ export default class UI {
|
|||
|
||||
static switchGrid () {
|
||||
ScratchAudio.sndFX('tap.wav');
|
||||
UI.toggleGrid(!Grid.hidden);
|
||||
UI.setShowGrid(Grid.hidden);
|
||||
iOS.analyticsEvent('editor', Grid.hidden ? 'hide_grid' : 'show_grid');
|
||||
}
|
||||
|
||||
static toggleGrid (b) {
|
||||
Grid.hide(b);
|
||||
iOS.analyticsEvent('editor', Grid.hidden ? 'hide_grid' : 'show_grid');
|
||||
static setShowGrid (b) {
|
||||
Grid.hide(!b);
|
||||
gn('grid').className = Grid.hidden ? 'gridToggle off' : 'gridToggle on';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue