From 64019e6fd83f52d47b44d6bf83c5086996ae9055 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Wed, 19 Aug 2020 10:25:47 -0400 Subject: [PATCH] fix to showing/hiding logo --- editions/free/src/css/start.css | 1 + src/entry/index.js | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/editions/free/src/css/start.css b/editions/free/src/css/start.css index 22d3030..ff64a1f 100644 --- a/editions/free/src/css/start.css +++ b/editions/free/src/css/start.css @@ -383,4 +383,5 @@ div.frame { .optionsList > div { display: block; padding: .25em; + break-inside: avoid-column; /* don't allow column to break inside item */ } diff --git a/src/entry/index.js b/src/entry/index.js index 145c076..b1e9480 100644 --- a/src/entry/index.js +++ b/src/entry/index.js @@ -100,6 +100,7 @@ function indexHideSplash () { function indexLoadStart () { indexHideSplash(); + showLogo(); gn('gettings').className = 'gettings show'; gn('startcode').className = 'startcode show'; document.ontouchmove = function (e) { @@ -111,7 +112,6 @@ function indexLoadStart () { } function indexAskRemainingQuestions () { - indexHideSplash(); var nextQuestionKey = InitialOptions.nextUnansweredQuestion(); if (nextQuestionKey) { indexShowQuestion(nextQuestionKey); @@ -120,14 +120,22 @@ function indexAskRemainingQuestions () { } } +function hideLogo () { + gn('catface').className = 'catface hide'; + gn('jrlogo').className = 'jrlogo hide'; +} + +function showLogo () { + gn('catface').className = 'catface show'; + gn('jrlogo').className = 'jrlogo show'; +} + function indexAskPlace () { gn('authors').className = 'credits show'; gn('authorsText').className = 'creditsText hide'; gn('purpleguy').className = 'purple hide'; gn('blueguy').className = 'blue hide'; gn('redguy').className = 'red hide'; - gn('catface').className = 'catface hide'; - gn('jrlogo').className = 'jrlogo hide'; gn('usageQuestion').textContent = Localization.localize('USAGE_QUESTION'); gn('useSchoolText').textContent = Localization.localize('USAGE_SCHOOL'); @@ -206,6 +214,8 @@ function optionTouched (elem) { // show the question for a given settings option key function indexShowQuestion (key) { + indexHideSplash(); + hideLogo(); var optionType = InitialOptions.optionTypeForKey(key); if (optionType === 'place') { indexAskPlace(); @@ -241,6 +251,7 @@ function indexShowQuestion (key) { case 'image': var imgElem = document.createElement('img'); imgElem.setAttribute('src', 'svglibrary/' + option); + imgElem.setAttribute('style', 'max-width: 150px; max-height: 90px'); optionElem.appendChild(imgElem); break; case 'text':