Commit a6217e5c authored by Iuri Matias's avatar Iuri Matias Committed by yann300

fix issues with lack of view

parent 578137ad
...@@ -128,6 +128,7 @@ ButtonNavigator.prototype.updateDisabled = function (id, disabled) { ...@@ -128,6 +128,7 @@ ButtonNavigator.prototype.updateDisabled = function (id, disabled) {
} }
ButtonNavigator.prototype.resetWarning = function (revertedReason) { ButtonNavigator.prototype.resetWarning = function (revertedReason) {
if (!this.view) return
this.view.querySelector('#reverted #outofgas').style.display = (revertedReason === 'outofgas') ? 'inline' : 'none' this.view.querySelector('#reverted #outofgas').style.display = (revertedReason === 'outofgas') ? 'inline' : 'none'
this.view.querySelector('#reverted #parenthasthrown').style.display = (revertedReason === 'parenthasthrown') ? 'inline' : 'none' this.view.querySelector('#reverted #parenthasthrown').style.display = (revertedReason === 'parenthasthrown') ? 'inline' : 'none'
this.view.querySelector('#reverted').style.display = (revertedReason === '') ? 'none' : 'block' this.view.querySelector('#reverted').style.display = (revertedReason === '') ? 'none' : 'block'
......
...@@ -13,6 +13,7 @@ class Slider { ...@@ -13,6 +13,7 @@ class Slider {
} }
setSliderLength (length) { setSliderLength (length) {
if (!this.view) return
this.view.querySelector('#slider').setAttribute('max', length - 1) this.view.querySelector('#slider').setAttribute('max', length - 1)
this.max = length - 1 this.max = length - 1
this.disabled = (length === 0) this.disabled = (length === 0)
...@@ -27,6 +28,7 @@ class Slider { ...@@ -27,6 +28,7 @@ class Slider {
} }
onChange (event) { onChange (event) {
if (!this.view) return
var value = parseInt(this.view.querySelector('#slider').value) var value = parseInt(this.view.querySelector('#slider').value)
if (value === this.previousValue) return if (value === this.previousValue) return
...@@ -35,6 +37,7 @@ class Slider { ...@@ -35,6 +37,7 @@ class Slider {
} }
setValue (value) { setValue (value) {
if (!this.view) return
this.view.querySelector('#slider').value = value this.view.querySelector('#slider').value = value
} }
......
...@@ -35,6 +35,7 @@ StepManager.prototype.startButtonNavigator = function () { ...@@ -35,6 +35,7 @@ StepManager.prototype.startButtonNavigator = function () {
} }
StepManager.prototype.updateStep = function (step, stepState, jumpOutDisabled) { StepManager.prototype.updateStep = function (step, stepState, jumpOutDisabled) {
if (!this.slider) return
this.slider.setValue(step) this.slider.setValue(step)
this.buttonNavigator.stepChanged(stepState, jumpOutDisabled) this.buttonNavigator.stepChanged(stepState, jumpOutDisabled)
this.event.trigger('stepChanged', [step]) this.event.trigger('stepChanged', [step])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment