mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
Merge pull request #212 from chrisgarrity/hide-parents-button
Hide parents button after succesful parental gate
This commit is contained in:
commit
743f1974c5
1 changed files with 7 additions and 3 deletions
|
@ -32,7 +32,7 @@ export default class UI {
|
|||
static get infoBoxOpen () {
|
||||
return infoBoxOpen;
|
||||
}
|
||||
|
||||
|
||||
static layout () {
|
||||
UI.topSection();
|
||||
UI.middleSection();
|
||||
|
@ -120,6 +120,8 @@ export default class UI {
|
|||
if (window.Settings.shareEnabled) {
|
||||
// For Parents button
|
||||
var parentsSection = newHTML('div', 'infoboxParentsSection', infobox);
|
||||
parentsSection.setAttribute('id', 'parentsection');
|
||||
|
||||
var parentsButton = newHTML('div', 'infoboxParentsButton', parentsSection);
|
||||
parentsButton.id = 'infoboxParentsSectionButton';
|
||||
parentsButton.textContent = Localization.localize('FOR_PARENTS');
|
||||
|
@ -160,7 +162,7 @@ export default class UI {
|
|||
|
||||
parentsButton.ontouchstart = function (e) {
|
||||
UI.parentalGate(e, function (e) {
|
||||
UI.showSharing(e, shareButtons);
|
||||
UI.showSharing(e, shareButtons, parentsSection);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@ -231,8 +233,9 @@ export default class UI {
|
|||
}
|
||||
}
|
||||
|
||||
static showSharing (evt, shareButtons) {
|
||||
static showSharing (evt, shareButtons, parentsSection) {
|
||||
shareButtons.style.visibility = 'visible';
|
||||
parentsSection.style.visibility = 'hidden';
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -452,6 +455,7 @@ export default class UI {
|
|||
gn('infobox').className = 'infobox fade';
|
||||
}
|
||||
gn('sharebuttons').style.visibility = 'hidden';
|
||||
gn('parentsection').style.visibility = 'visible';
|
||||
infoBoxOpen = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue