Fix state resetting and button display
This commit is contained in:
10
src/main.js
10
src/main.js
@ -10,13 +10,19 @@ const defaultState = {
|
|||||||
|
|
||||||
var state = defaultState
|
var state = defaultState
|
||||||
|
|
||||||
|
function clearState() {
|
||||||
|
|
||||||
|
state = JSON.parse(JSON.stringify(defaultState))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function changeView(view) {
|
function changeView(view) {
|
||||||
|
|
||||||
for (el of document.querySelectorAll('.view'))
|
for (el of document.querySelectorAll('.view'))
|
||||||
el.style.display = 'none'
|
el.style.display = 'none'
|
||||||
|
|
||||||
document.getElementById(view).style.display = 'block'
|
document.getElementById(view).style.display = 'inline-block'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +239,7 @@ function createQuiz() {
|
|||||||
|
|
||||||
console.log('Creating new quiz')
|
console.log('Creating new quiz')
|
||||||
|
|
||||||
state = defaultState
|
clearState()
|
||||||
removeLink()
|
removeLink()
|
||||||
|
|
||||||
if (parseSpreadsheet().success == false)
|
if (parseSpreadsheet().success == false)
|
||||||
|
|||||||
Reference in New Issue
Block a user