From 33fd4b74eb114a30d64c83b52013653a63827a8f Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 4 Sep 2019 10:51:06 +0200 Subject: [PATCH 1/3] change selected corresponding to nightly check --- src/app/tabs/compileTab/compilerContainer.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/tabs/compileTab/compilerContainer.js b/src/app/tabs/compileTab/compilerContainer.js index 42ba952a0c..696dbda7bd 100644 --- a/src/app/tabs/compileTab/compilerContainer.js +++ b/src/app/tabs/compileTab/compilerContainer.js @@ -284,18 +284,27 @@ class CompilerContainer { this._updateLanguageSelector() } + _shouldBeAdded(version) { + return !version.includes('nightly') || + (version.includes('nightly') && this._view.includeNightlies.checked) + } + _updateVersionSelector () { + // update selectedversion of previous one got filtered out + if (!this._shouldBeAdded(this.data.selectedVersion)) { + this.data.selectedVersion = this.data.defaultVersion + } this._view.versionSelector.innerHTML = '' this.data.allversions.forEach(build => { const option = build.path === this.data.selectedVersion ? yo`` : yo`` - - if (!option.innerText.includes('nightly') || - (option.innerText.includes('nightly') && this._view.includeNightlies.checked)) { + + if (this._shouldBeAdded(option.innerText)) { this._view.versionSelector.appendChild(option) } }) + this._view.versionSelector.removeAttribute('disabled') this.queryParams.update({ version: this.data.selectedVersion }) let url From 132a3a3e6cb15a202fed01e80c6fbc6b4da5688f Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 4 Sep 2019 10:56:21 +0200 Subject: [PATCH 2/3] standard --- src/app/tabs/compileTab/compilerContainer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/compileTab/compilerContainer.js b/src/app/tabs/compileTab/compilerContainer.js index 696dbda7bd..a463fb884e 100644 --- a/src/app/tabs/compileTab/compilerContainer.js +++ b/src/app/tabs/compileTab/compilerContainer.js @@ -284,7 +284,7 @@ class CompilerContainer { this._updateLanguageSelector() } - _shouldBeAdded(version) { + _shouldBeAdded (version) { return !version.includes('nightly') || (version.includes('nightly') && this._view.includeNightlies.checked) } @@ -299,7 +299,7 @@ class CompilerContainer { const option = build.path === this.data.selectedVersion ? yo`` : yo`` - + if (this._shouldBeAdded(option.innerText)) { this._view.versionSelector.appendChild(option) } From 2b4981473657ef82c9dbefa36ae7396cae387326 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 4 Sep 2019 11:06:09 +0200 Subject: [PATCH 3/3] Update compilerContainer.js --- src/app/tabs/compileTab/compilerContainer.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/tabs/compileTab/compilerContainer.js b/src/app/tabs/compileTab/compilerContainer.js index a463fb884e..791adb0a0d 100644 --- a/src/app/tabs/compileTab/compilerContainer.js +++ b/src/app/tabs/compileTab/compilerContainer.js @@ -304,7 +304,6 @@ class CompilerContainer { this._view.versionSelector.appendChild(option) } }) - this._view.versionSelector.removeAttribute('disabled') this.queryParams.update({ version: this.data.selectedVersion }) let url