Skip to content

Commit

Permalink
Format slider value to string AFTER start < end check
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed May 3, 2024
1 parent d48ac3e commit 629e277
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/views/channel_slider_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ var ChannelSliderView = Backbone.View.extend({
let $target = $(event.target);
let value = parseFloat(event.target.value);
let max = $target.attr('max');
let min = $target.attr('min');
let chIndex = $target.data('idx');
value = (max > SLIDER_INCR_CUTOFF) ? value : value.toFixed(2);
// ensure that start < end
const start = $target.hasClass("ch_start_slider");
if (start) {
Expand All @@ -236,7 +236,8 @@ var ChannelSliderView = Backbone.View.extend({
return;
}
}
// simply update the correct text input...
// simply format and update the correct text input...
value = (max - min > SLIDER_INCR_CUTOFF) ? value : value.toFixed(2);
if (start){
$(`.channel_slider_${chIndex} .ch_start input`).val(value);
} else {
Expand Down

0 comments on commit 629e277

Please sign in to comment.