diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-10-28 13:29:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-28 13:29:54 +0100 |
| commit | 93fa55749c40ed1f1a7bee9157bce81708988656 (patch) | |
| tree | c386e6f0cbac347d15cc10a64d044cb70a6df7f0 /frontend/src/components/modals/custom-components/NewScenarioModalComponent.js | |
| parent | 44342c83b886c4d65ef8b74a3bea1d0e12b37f38 (diff) | |
| parent | 34b45675b3de56c847818dbcc829f7ce02ddce56 (diff) | |
Merge pull request #52 from atlarge-research/refactor/jquery
Eliminate jQuery from frontend dependencies
Diffstat (limited to 'frontend/src/components/modals/custom-components/NewScenarioModalComponent.js')
| -rw-r--r-- | frontend/src/components/modals/custom-components/NewScenarioModalComponent.js | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js index d7d99982..5ba74b0f 100644 --- a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js +++ b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js @@ -19,21 +19,25 @@ class NewScenarioModalComponent extends React.Component { } componentDidUpdate() { - if (this.props.currentPortfolioScenarioIds.length === 0) { - this.textInput.value = 'Base scenario' - } else if (this.textInput.value === 'Base scenario') { - this.textInput.value = '' + if (this.textInput) { + if (this.props.currentPortfolioScenarioIds.length === 0) { + this.textInput.value = 'Base scenario' + } else if (this.textInput.value === 'Base scenario') { + this.textInput.value = '' + } } } reset() { - this.textInput.value = this.props.currentPortfolioScenarioIds.length === 0 ? 'Base scenario' : '' - this.traceSelect.selectedIndex = 0 - this.traceLoadInput.value = 1.0 - this.topologySelect.selectedIndex = 0 - this.failuresCheckbox.checked = false - this.performanceInterferenceCheckbox.checked = false - this.schedulerSelect.selectedIndex = 0 + if (this.textInput) { + this.textInput.value = this.props.currentPortfolioScenarioIds.length === 0 ? 'Base scenario' : '' + this.traceSelect.selectedIndex = 0 + this.traceLoadInput.value = 1.0 + this.topologySelect.selectedIndex = 0 + this.failuresCheckbox.checked = false + this.performanceInterferenceCheckbox.checked = false + this.schedulerSelect.selectedIndex = 0 + } } onSubmit() { |
