IonDen / ion.rangeSlider

jQuery only range slider
http://ionden.com/a/plugins/ion.rangeSlider/en.html
MIT License
2.55k stars 506 forks source link

HTML data- attributes are ignored if they are set to false #413

Closed wch closed 7 years ago

wch commented 8 years ago

Setting a config option via a HTML data- attribute doesn't work if the value is "false". Example here, where it ignores data-prettify-enabled="false" but respects data-prettify-separator=",": http://jsfiddle.net/winstonchang/hksvez8c/5/

I believe the problem is that the value is dropped from config_from_data when the value is falsy but non-zero: https://github.com/IonDen/ion.rangeSlider/blob/28376dfea1ed7aaa25148a4aa12b5727da590d66/js/ion.rangeSlider.js#L386-L388

IonDen commented 8 years ago

Hi, maybe i need an additional check there. But now you can use something, that jquery will definitely convert correctly, like 1/0: http://jsfiddle.net/hksvez8c/6/

wch commented 8 years ago

Excellent, using "0" does work here. I'll use that workaround for now.

I should also note that using data-prettify-separator="" also doesn't work because it's a falsy value.

IonDen commented 7 years ago

Should be fixed in 2.1.5