angular-bootstrap-slider icon indicating copy to clipboard operation
angular-bootstrap-slider copied to clipboard

Remove legacy `picker` code

Open jespirit opened this issue 5 years ago • 2 comments

The directive still references the picker object that is legacy code dating back to Bootstrap-Slider version 3.0.0

Current usage in this AngularJS directive

// check if slider jQuery plugin exists
if (typeof window.$ !== 'undefined' && typeof $.fn === 'object' && $.fn.slider) {
    // adding methods to jQuery slider plugin prototype
    $.fn.slider.constructor.prototype.disable = function () {
        this.picker.off();
    };
    $.fn.slider.constructor.prototype.enable = function () {
        this.picker.on();
    };
}

Legacy code

if (parent.hasClass('slider') === true) {
    updateSlider = true;
    this.picker = parent;
} else {
    this.picker = $('<div class="slider">'+
                        '<div class="slider-track">'+
                            '<div class="slider-selection"></div>'+
                            '<div class="slider-handle"></div>'+
                            '<div class="slider-handle"></div>'+
                        '</div>'+
                        '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'+
                    '</div>')
                        .insertBefore(this.element)
                        .append(this.element);
}

jespirit avatar Feb 22 '19 15:02 jespirit

I will do it.

yuansheng1989 avatar Feb 22 '19 15:02 yuansheng1989

Always happy to add maintainers over here - I don't use this anymore and will not be coming back to it. Feel free to put up a PR!

seiyria avatar Feb 22 '19 17:02 seiyria