Panman82 / ember-bootstrap-switch

An ember-cli addon to import bootstrap-switch and provide an Ember component.
MIT License
5 stars 4 forks source link

Should fix #10 #11

Closed jelhan closed 8 years ago

jelhan commented 8 years ago

Not quite sure if it works for all expected cases. Should work fine if property is a string, a string object or Handlebars SafeString object. Tests would be nice.

Should fix #10.

Panman82 commented 8 years ago

I'm going to take a closer look at this one, I think we'll need to do a little more type checking instead, since other options could contain something other than string values. Specifically; handleWidth, labelWidth, and wrapperClass.

jelhan commented 8 years ago

labelWidth and handleWidth accepts strings. It's safe to perform toString on numbers and number objects.

wrapperClass could be a string or an array. Array also has a toString method but I'm not sure if bootstrap switch behaves the same for ['foo', 'bar'] and 'foo,bar' as wrapperClass.

If it make a difference I would simply add a check if wrapperClass is an array and in this case doesn't touch it.

Panman82 commented 8 years ago

I've implemented a slightly different solution, let's move back to the issue (I'll re-open).