Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options not setting #319

Closed
umedbisht opened this issue Jun 3, 2014 · 1 comment
Closed

Options not setting #319

umedbisht opened this issue Jun 3, 2014 · 1 comment
Assignees
Milestone

Comments

@umedbisht
Copy link

Not able to set options when calling
$('#id').bootstrapSwitch({size: 'small', disabled: true})

To fix this issue, please change following statement:

this.options = $.extend({}, $.fn.bootstrapSwitch.defaults, options, {
          state: this.$element.is(":checked"),
          size: this.$element.data("size"),
          animate: this.$element.data("animate"),
          disabled: this.$element.is(":disabled"),
          readonly: this.$element.is("[readonly]"),
          indeterminate: this.$element.data("indeterminate"),
          onColor: this.$element.data("on-color"),
          offColor: this.$element.data("off-color"),
          onText: this.$element.data("on-text"),
          offText: this.$element.data("off-text"),
          labelText: this.$element.data("label-text"),
          baseClass: this.$element.data("base-class"),
          wrapperClass: this.$element.data("wrapper-class")
        });

with this:

this.options = $.extend({}, $.fn.bootstrapSwitch.defaults, {
          state: this.$element.is(":checked"),
          size: this.$element.data("size"),
          animate: this.$element.data("animate"),
          disabled: this.$element.is(":disabled"),
          readonly: this.$element.is("[readonly]"),
          indeterminate: this.$element.data("indeterminate"),
          onColor: this.$element.data("on-color"),
          offColor: this.$element.data("off-color"),
          onText: this.$element.data("on-text"),
          offText: this.$element.data("off-text"),
          labelText: this.$element.data("label-text"),
          baseClass: this.$element.data("base-class"),
          wrapperClass: this.$element.data("wrapper-class")
        }, options);
@LostCrew LostCrew changed the title options not setting Options not setting Jun 3, 2014
@LostCrew LostCrew added the bug label Jun 3, 2014
@LostCrew LostCrew added this to the 3.0.2 milestone Jun 3, 2014
@LostCrew LostCrew self-assigned this Jun 3, 2014
@LostCrew
Copy link
Member

LostCrew commented Jun 3, 2014

hi @umedbisht,
i checked if the proposed pattern matches with official bootstrap plugins one. it does. to be released with the next minor version. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants