the option size is doesn't work?
No matter whether I use the $(...). bootstrapSwitch ({size:"small"}) or add data-size = "small" to the input, I can't achieve small space. By the way, I found that there are lots of bootstrap-switch-undefined in the class attribute of wrapper which contains the switch elements.
I have the same problem. i use the CSS file and not the less file.
CSS and JS are v.3.3.4 on the demo site as in the repository, but the version on the site works! bootstrap-switch.js bootstrap-switch.css
https://github.com/Bttstrp/bootstrap-switch/blob/master/dist/js/bootstrap-switch.js
function getClasses(options, id) {
var state = options.state,
size = options.size,
disabled = options.disabled,
readonly = options.readonly,
indeterminate = options.indeterminate,
inverse = options.inverse;
return [state ? 'on' : 'off', size, disabled ? 'disabled' : undefined, readonly ? 'readonly' : undefined, indeterminate ? 'indeterminate' : undefined, inverse ? 'inverse' : undefined, id ? 'id-' + id : undefined].filter(function (v) {
return v == null;
});
}
be revised as
function getClasses(options, id) {
var state = options.state,
size = options.size,
disabled = options.disabled,
readonly = options.readonly,
indeterminate = options.indeterminate,
inverse = options.inverse;
return [state ? 'on' : 'off', size, disabled ? 'disabled' : undefined, readonly ? 'readonly' : undefined, indeterminate ? 'indeterminate' : undefined, inverse ? 'inverse' : undefined, id ? 'id-' + id : undefined].filter(function (v) {
return v != null;
});
}
Returns the option of null:
return v == null;
So it's all undefined
@matusmark bootstrap-switch. Js is right
@Wong-Dy you are correct, please submit a pull-request because it works as intended just by changing that
FYI Fixed by #713 Still waiting for this PR to be merged.
https://github.com/Bttstrp/bootstrap-switch/blob/master/dist/js/bootstrap-switch.js
function getClasses(options, id) { var state = options.state, size = options.size, disabled = options.disabled, readonly = options.readonly, indeterminate = options.indeterminate, inverse = options.inverse; return [state ? 'on' : 'off', size, disabled ? 'disabled' : undefined, readonly ? 'readonly' : undefined, indeterminate ? 'indeterminate' : undefined, inverse ? 'inverse' : undefined, id ? 'id-' + id : undefined].filter(function (v) { return v == null; }); }be revised as
function getClasses(options, id) { var state = options.state, size = options.size, disabled = options.disabled, readonly = options.readonly, indeterminate = options.indeterminate, inverse = options.inverse; return [state ? 'on' : 'off', size, disabled ? 'disabled' : undefined, readonly ? 'readonly' : undefined, indeterminate ? 'indeterminate' : undefined, inverse ? 'inverse' : undefined, id ? 'id-' + id : undefined].filter(function (v) { return v != null; }); }Returns the option of null:
return v == null;So it's all undefined
I had a try as this just, but it seems not to work