From b5ae84175717877e669436ea4aba964ac671b630 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 26 Jan 2017 17:28:29 +0100 Subject: [PATCH] add setReducedTrace --- src/ui/SoliditySlider.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ui/SoliditySlider.js b/src/ui/SoliditySlider.js index d411e80c7b..cc9dd54cc7 100644 --- a/src/ui/SoliditySlider.js +++ b/src/ui/SoliditySlider.js @@ -3,12 +3,18 @@ var Slider = require('./Slider') var utils = require('../helpers/util.js') class SoliditySlider extends Slider { - constructor (_traceManager, reducedTraceBySourceLocation) { + constructor (_traceManager) { super(_traceManager) - this.reducedTraceBySourceLocation = reducedTraceBySourceLocation + this.reducedTraceBySourceLocation } - setValue (value) { - super.setValue(utils.findLowerBoundValue(value, this.reducedTraceBySourceLocation)) + setValue (_value) { + if (this.reducedTraceBySourceLocation) { + super.setValue(utils.findLowerBound(_value, this.reducedTraceBySourceLocation)) + } + } + setReducedTrace (_reducedTraceBySourceLocation) { + super.init(_reducedTraceBySourceLocation.length) + this.reducedTraceBySourceLocation = _reducedTraceBySourceLocation } }