Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
scale: function(x) {
let min = this.model.get('min');
let max = this.model.get('max');
return (x - min) / (max - min);
},
unscale: function(x) {
let min = this.model.get('min');
let max = this.model.get('max');
return min + x * (max - min);
}
};
let FixedFloatSliderModel = widgets_ctrl.FloatSliderModel.extend({
defaults: _.extend({}, widgets_ctrl.FloatSliderModel.prototype.defaults, {
_model_name : 'FixedFloatSliderModel',
_view_name : 'FixedFloatSliderView',
_model_module : 'odysis',
_view_module : 'odysis',
_model_module_version : odysis_version,
_view_module_version : odysis_version
})
});
let FixedFloatSliderView = widgets_ctrl.FloatSliderView.extend(FixedFloatSliderBaseView).extend({
render: function() {
FixedFloatSliderView.__super__.render.apply(this, arguments);
this.$slider.slider('option', 'min', 0);
this.$slider.slider('option', 'max', 1);
let min = this.model.get('min');
let max = this.model.get('max');
return (x - min) / (max - min);
},
unscale: function(x) {
let min = this.model.get('min');
let max = this.model.get('max');
return min + x * (max - min);
}
};
let FixedFloatSliderModel = widgets_ctrl.FloatSliderModel.extend({
defaults: _.extend({}, widgets_ctrl.FloatSliderModel.prototype.defaults, {
_model_name : 'FixedFloatSliderModel',
_view_name : 'FixedFloatSliderView',
_model_module : 'odysis',
_view_module : 'odysis',
_model_module_version : odysis_version,
_view_module_version : odysis_version
})
});
let FixedFloatSliderView = widgets_ctrl.FloatSliderView.extend(FixedFloatSliderBaseView).extend({
render: function() {
FixedFloatSliderView.__super__.render.apply(this, arguments);
this.$slider.slider('option', 'min', 0);
this.$slider.slider('option', 'max', 1);
},