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

Remove attaching bootstrapSwitch to any element with class 'switch' #70

Closed
softlabs-2 opened this issue Jun 20, 2013 · 2 comments
Closed

Comments

@softlabs-2
Copy link

Was using bootstrap-switch inside one of my projects. The one issue I have is that inside bootstrapSwitch.js on line 237, you have attached the bootstrapSwitch to any element with a class of switch.

$(function () {
  $('.switch')['bootstrapSwitch']();
});

The problem I am having is that it then affects one of my other js library files ( bootstrap-datepicker.js) which use the class switch for styling element (which I find is a very generic name):

screen shot 2013-06-20 at 12 22 51

I know that if I remove the snippet from your library file it will fix this issue however I would then have to remember to remove this every time I update your script.

I propose maybe changing the name of the class to .bootstrap-switch or removing it from the library file.

Any feedback would be appreciated.

Thomas

@CGollhardt
Copy link

+1

Same here. Refer to following Bug:
uxsolutions/bootstrap-datepicker#416

Would be nice to have a fix in the official Solution.

@CGollhardt
Copy link

I dont know how i can make a pull request. But for me i have fixed this by replacing "switch" with "dtpswitch" on JS and CSS file.

Then i have replaced "dtpswitch(" with "switch(" in the JS File. Seems to working fine. But would be better to do this in the official project.

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

No branches or pull requests

3 participants