jQRangeSlider
jQRangeSlider copied to clipboard
Formatter destroyed after option update
trafficstars
When updating options the second time you get an "a is not function" error. This is caused in jQRangeSlider.js line 177:
_setFormatterOption: function(key, value){
if (key === "formatter" && value !== null && typeof value === "function"){
if (this.options.valueLabels !== "hide"){
this._leftLabel("option", "formatter", value);
this.options.formatter = this._rightLabel("option", "formatter", value);
}
}
}
The override of the this.options.formatter causes the issue on the next option set when the labels are updated. If you simple remove this, this issue is fixed:
_setFormatterOption: function(key, value){
if (key === "formatter" && value !== null && typeof value === "function"){
if (this.options.valueLabels !== "hide"){
this._leftLabel("option", "formatter", value);
this._rightLabel("option", "formatter", value);
}
}
}