jQRangeSlider icon indicating copy to clipboard operation
jQRangeSlider copied to clipboard

Formatter destroyed after option update

Open stmoeller opened this issue 9 years ago • 0 comments
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);
                }
            }
        }

stmoeller avatar Apr 14 '16 06:04 stmoeller