mirror of
https://github.com/wassname/template.git
synced 2026-07-26 13:37:31 +08:00
String -> Number
This commit is contained in:
+4
-5
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user