show and hide editor

This commit is contained in:
ojack
2022-02-11 15:22:52 +01:00
parent 323daa37f7
commit b9c8179b36
2 changed files with 34 additions and 2 deletions

View File

@@ -14,9 +14,25 @@ module.exports = class Editor extends Component {
this.editor.on("*", (e, t) => {
this.emit(e)
})
// hacky, maybe not necessary
this.innerText = document.getElementsByClassName('CodeMirror')[0]
}
update (center) {
hide() {
this.innerText.style.opacity = 0
}
show() {
this.innerText.style.opacity = 1
this.innerText.style.pointerEvents = 'all'
}
update (state) {
if(state.showInfo === true) {
this.hide()
} else {
this.show()
}
return false
}