mirror of
https://github.com/wallabag/wallabag.git
synced 2026-11-16 05:25:38 +01:00
The Materialize dist bundle implicitly called M.Range.init on all input[type=range] elements. The new range_controller replaces that implicit call with an explicit Stimulus lifecycle: M.Range.init on connect and destroy on disconnect. The three range inputs in the reading settings tab (lineHeight, fontsize, maxWidth) now carry data-controller="materialize--range" and gain the canonical .range-field class alongside the existing .input-field, which is the structure Materialize v1.2.2 expects for its range slider styling.
15 lines
324 B
JavaScript
15 lines
324 B
JavaScript
import { Controller } from '@hotwired/stimulus';
|
|
import M from '@materializecss/materialize';
|
|
|
|
export default class extends Controller {
|
|
connect() {
|
|
this.instance = M.Range.init(this.element.querySelector('input[type=range]'));
|
|
}
|
|
|
|
disconnect() {
|
|
if (this.instance) {
|
|
this.instance.destroy();
|
|
}
|
|
}
|
|
}
|