Sha256: 09befa24e0df440d069fe870eb7344960577867ea89cdfcb3f3e1f07bd62d9ae
Contents?: true
Size: 419 Bytes
Versions: 10
Compression:
Stored size: 419 Bytes
Contents
import { Controller } from "@hotwired/stimulus"; export default class UISliderController extends Controller { updateRange() { const input = this.element; const min = input.min; const max = input.max; const val = input.value; const fillRatio = parseInt(((val - min) * 100) / (max - min)); input.style = `background-size: ${fillRatio}% 100%`; input.setAttribute("value", fillRatio); } }
Version data entries
10 entries across 10 versions & 1 rubygems