seiyria / bootstrap-slider

A slider control for Bootstrap 3 & 4.
http://seiyria.github.io/bootstrap-slider/
Other
3k stars 1.14k forks source link

Fix namespace handling #893

Closed jespirit closed 5 years ago

jespirit commented 5 years ago

I noticed these two lines were incorrect. The slider instance that is added/removed should be based on the namespace, either: slider or bootstrapSlider.

https://github.com/seiyria/bootstrap-slider/blob/88dfe2aa20bb49f524b681062e6ea15d26402c41/src/js/bootstrap-slider.js#L995

https://github.com/seiyria/bootstrap-slider/blob/88dfe2aa20bb49f524b681062e6ea15d26402c41/src/js/bootstrap-slider.js#L1064

I added unit tests.

I also fixed some unit tests that were not properly destroying the <div> slider element. This caused some unit tests to fail when it used .siblings() to check the <div> slider element, but the method also collects more than 1 <div> if they exist, which was causing hard to track bugs.

Pull Requests

Please accompany all pull requests with the following (where appropriate):