fix issues with lack of view

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 578137ad2e
commit a6217e5cc6
  1. 1
      src/app/debugger/debuggerUI/ButtonNavigator.js
  2. 3
      src/app/debugger/debuggerUI/Slider.js
  3. 1
      src/app/debugger/debuggerUI/StepManager.js

@ -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 {
} }
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 {
} }
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 {
} }
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 () {
} }
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])

Loading…
Cancel
Save