String -> Number

This commit is contained in:
Shan Carter
2017-10-12 10:38:10 -07:00
parent 8c79954f2d
commit 8553a6d7c3
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -137,10 +137,10 @@ export class Slider extends T(HTMLElement) {
this.background = this.root.querySelector(".background");
this.trackFill = this.root.querySelector(".track-fill");
this.track = this.root.querySelector(".track");
this.min = this.hasAttribute("min") ? this.getAttribute("min") : 0;
this.max = this.hasAttribute("max") ? this.getAttribute("max") : 100;
this.value = this.hasAttribute("value") ? this.getAttribute("value") : 0;
this.step = this.hasAttribute("step") ? this.getAttribute("step") : 1;
this.min = this.hasAttribute("min") ? +this.getAttribute("min") : 0;
this.max = this.hasAttribute("max") ? +this.getAttribute("max") : 100;
this.value = this.hasAttribute("value") ? +this.getAttribute("value") : 0;
this.step = this.hasAttribute("step") ? +this.getAttribute("step") : 1;
this.scale = scaleLinear().domain([this.min, this.max]).range([0, 1]).clamp(true);
this.drag = drag()
.container(this.track)
@@ -201,7 +201,6 @@ export class Slider extends T(HTMLElement) {
break;
}
if (stopPropagation) {
this.background.classList.add("focus");
e.preventDefault();
e.stopPropagation();
}