From 1c8c01121d3a3cce8a50fdeededd1f08b436f927 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 6 Sep 2018 10:14:28 -0400 Subject: [PATCH] remove method/simplify --- src/app/debugger/debuggerUI/Slider.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/app/debugger/debuggerUI/Slider.js b/src/app/debugger/debuggerUI/Slider.js index f3b1a0383d..f030d77e67 100644 --- a/src/app/debugger/debuggerUI/Slider.js +++ b/src/app/debugger/debuggerUI/Slider.js @@ -38,8 +38,14 @@ class Slider { var slider = this.view.querySelector('#slider') slider.setAttribute('max', length - 1) this.max = length - 1 - this.updateDisabled(length === 0) - this.disabled = length === 0 + this.disabled = (length === 0) + + if (this.disabled) { + this.view.querySelector('#slider').setAttribute('disabled', true) + } else { + this.view.querySelector('#slider').removeAttribute('disabled') + } + this.setValue(0) } @@ -61,13 +67,6 @@ class Slider { this.view.querySelector('#slider').value = value } - updateDisabled (disabled) { - if (disabled) { - this.view.querySelector('#slider').setAttribute('disabled', true) - } else { - this.view.querySelector('#slider').removeAttribute('disabled') - } - } } module.exports = Slider