diff -r 02c04d2c8fd8 -r ac1eacb3aa33 src/widgets/Slice.js --- a/src/widgets/Slice.js Sun Nov 12 22:07:33 2017 +0100 +++ b/src/widgets/Slice.js Wed Sep 04 17:32:50 2024 +0200 @@ -1,23 +1,24 @@ /* The Slider Widget shows time position and allows seek */ +import sliceStyles from "./Slice.module.css"; -IriSP.Widgets.Slice = function(player, config) { - IriSP.Widgets.Widget.call(this, player, config); +const Slice = function(ns) { + return class extends ns.Widgets.Widget { +constructor(player, config) { + super(player, config); this.sliding = false; }; -IriSP.Widgets.Slice.prototype = new IriSP.Widgets.Widget(); - -IriSP.Widgets.Slice.prototype.defaults = { +static defaults = { show_arrow: false }; -IriSP.Widgets.Slice.prototype.template = +static template = '
' + '{{#show_arrow}}
{{/show_arrow}}'; -IriSP.Widgets.Slice.prototype.draw = function() { +draw() { this.renderTemplate(); @@ -75,14 +76,18 @@ }); }; -IriSP.Widgets.Slice.prototype.setBounds = function(begin, end) { +setBounds(begin, end) { this.$slider.slider("values", [ begin, end ]); }; -IriSP.Widgets.Slice.prototype.show = function() { +show() { this.$slider.show(); }; -IriSP.Widgets.Slice.prototype.hide = function() { +hide() { this.$slider.hide(); }; + + }} + +export { Slice, sliceStyles };