diff --git a/src/app/tabs/compileTab/compilerContainer.js b/src/app/tabs/compileTab/compilerContainer.js index f23d73b698..7ae59d6c93 100644 --- a/src/app/tabs/compileTab/compilerContainer.js +++ b/src/app/tabs/compileTab/compilerContainer.js @@ -37,7 +37,7 @@ class CompilerContainer { } if (!this._view.compilationButton) return const button = this.compilationButton(name.split('/').pop()) - this._disableCompileBtn(!name || name === '') + this._disableCompileBtn(!name) yo.update(this._view.compilationButton, button) } @@ -104,27 +104,25 @@ class CompilerContainer { /************** * SUBCOMPONENT */ - compilationButton (name) { - if (!name) name = '' - const displayed = name === '' ? '' : name - const disabled = name === '' ? 'disabled' : '' + compilationButton (name = '') { + const displayed = name || '' + const disabled = name ? '' : 'disabled' const compileBtn = yo` ` - let el = yo` + return yo`
${compileBtn}
` - return el } - _disableCompileBtn (disable) { - let btn = document.querySelector("button[id='compileBtn']") + _disableCompileBtn (shouldDisable) { + let btn = document.getElementById('compileBtn') if (!btn) return - if (disable) { + if (shouldDisable) { btn.classList.add('disabled') } else if (this.config.get('currentFile')) { btn.classList.remove('disabled')