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

Naming conflict with bootstrap #62

Closed
a1ee9b opened this issue Nov 12, 2013 · 12 comments
Closed

Naming conflict with bootstrap #62

a1ee9b opened this issue Nov 12, 2013 · 12 comments

Comments

@a1ee9b
Copy link

a1ee9b commented Nov 12, 2013

I ran into the same issue #33 was having. I was getting a grey, unclickable background but the modal wouldn't show.

The problem seems to be the name of the plugin because it runs into a naming conflict with Bootstrap! So I replaced every occurrence of the word "modal" with "jmodal" in the plugin and now it works as expected.

I suggest using another variable for the global namespace, since bootstrap is widely used.

P.S.: I opened a new issue so people using bootstrap will find the solution faster.

@kylefox
Copy link
Owner

kylefox commented Nov 13, 2013

Thanks for posting the issue! I'm not sure if this makes sense, because how many people who are using Bootstrap will actually be using my library? Bootstrap's modal is pretty good, and if you're already using Bootstrap anyway...

@alighazi
Copy link

I prefer using your modal despite using bootstrap library, bootstrap's library modal isn't that good.

@a1ee9b
Copy link
Author

a1ee9b commented Nov 15, 2013

Bootstraps modal feels a bit bloated for certain tasks. Which is why I wanted to evaluate other modal libraries.
This issue should be seen more as a "heads up" for people using bootstrap, than a real problem.

Still like this library very much. It feels very organized.

@kylefox
Copy link
Owner

kylefox commented Nov 15, 2013

Cool, thanks :)

I'm trying to decide if it's better to simply rename this library (if so, to what?) or allow a noConflict-type setting that lets the user decide what name to use, just defaulting to modal.

I don't even know if this would work (haven't tried yet) but something like:

$(function() {

    $.kfModalNoConflict('kfModal');

    // Object is now 'kfModal'
    $.kfModa({ ... });

});

Thoughts?

@luckyyang
Copy link

Same problem with Bootstrap in Rails 3.2.8, took me much time to position this issue.

Has a modal-backdrop from Bootstrap:
image

@luckyyang
Copy link

Just rename this library, I like simplicity, don't let me think. kfModal is OK. 👍

@a1ee9b
Copy link
Author

a1ee9b commented Dec 17, 2013

I think renaming is the easiest solution. But keep in mind it will break backwards-compatiblity...
kfModal will work as a name.

@kylefox
Copy link
Owner

kylefox commented Dec 17, 2013

I don't really want to rename this library. It breaks backwards compatibility, documentation needs to be updated, plus "modal" is simply more aesthetically pleasing to work with.

I would accept a pull-request that updates everything to $.Modal (uppercase). However I likely won't be making this change myself anytime soon.

@xtrasmal
Copy link

I just renamed it to kfModal. I only use it for jquery file api.
The rest is bootstrap. So good luck

@kzap
Copy link

kzap commented Oct 10, 2014

ya put in a noconflict and rename CSS classes

@kylefox
Copy link
Owner

kylefox commented Dec 7, 2014

Updated the README to give a heads up to this issue. However I'm not sure it's issue worth tackling.

@Luc45
Copy link

Luc45 commented Jul 31, 2015

I didn't understand the bootstrap solution, what do you mean by renaming the plugin?

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

7 participants