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

noConflict() still not working in 3.0.x #11464

Closed
colllin opened this issue Nov 13, 2013 · 8 comments
Closed

noConflict() still not working in 3.0.x #11464

colllin opened this issue Nov 13, 2013 · 8 comments

Comments

@colllin
Copy link
Contributor

colllin commented Nov 13, 2013

http://jsfiddle.net/colllin/jZUbB/

Unless I'm using it incorrectly... sorry for the bad news :)

@colllin
Copy link
Contributor Author

colllin commented Nov 13, 2013

Something along these lines might do the trick:
colllin@79d1c18

All I'm doing is defining the plugin function earlier on. That way I can reference it directly and .apply() it where I need it instead of trying to reference $().tooltip() (which no longer exists in noConflict mode).

@cvrebert
Copy link
Collaborator

tooltip and tab plugins' noConflict features claimed to be broken so far.

@fat
Copy link
Member

fat commented Nov 15, 2013

@colllin - nice! but function's are hoisted, so no need to move it up in code like that if you do function Plugin() that way we can keep that code consistent across the plugins

@colllin
Copy link
Contributor Author

colllin commented Dec 1, 2013

Modal plugin is affected:

.modal(option, this)

Scrollspy plugin is affected:

$spy.scrollspy($spy.data())

Affix plugin is affected:

$spy.affix(data)

Button plugin is affected:

$btn.button('toggle')

Collapse plugin is affected:

actives.collapse('hide')

$target.collapse(option)

Carousel plugin is affected:

$target.carousel(options)

$carousel.carousel($carousel.data())

These are the obvious ones -- found by searching for .carousel(, etc. The original dropdown one I sent over was a more obscure reference to $.fn.dropdown so it might take someone reading the code in depth to find more of those, or maybe search for ]( to find any other variable function names that are being used and rule them out one-by-one.

So far: tooltip, tab, modal, scrollspy, affix, button, collapse, carousel claimed to be broken.

@colllin
Copy link
Contributor Author

colllin commented Dec 10, 2013

I was thinking about writing tests for this. It seems like I have to decide between two strategies. The easiest is probably to run all tests in noConflict mode, with some global reference (window.affixPlugin) to the original plugin, and rewrite all existing tests to use that global reference. The other option is to rewrite all tests to accept a passed-in reference to the plugin, and then run all tests once normally then again in noConflict mode.

Would this be valuable or would you rather that I just spend the time fixing the plugins?

@cvrebert cvrebert mentioned this issue Dec 11, 2013
colllin added a commit to colllin/bootstrap that referenced this issue Dec 21, 2013
colllin added a commit to colllin/bootstrap that referenced this issue Dec 21, 2013
…internal reference to the jQuery plugin, because in noConflict mode you can never expect to be defined on the jQuery object
@fat
Copy link
Member

fat commented Dec 30, 2013

@colllin could you open a pull request when you get this in a good spot? thanks!

@colllin
Copy link
Contributor Author

colllin commented Dec 31, 2013

Sorry - I did. But I couldn't figure out how to attach it directly to this issue. #11966

@cvrebert
Copy link
Collaborator

cvrebert commented Jan 9, 2014

Closing in favor of your pull request.

@cvrebert cvrebert closed this as completed Jan 9, 2014
colllin added a commit to colllin/bootstrap that referenced this issue Apr 22, 2014
…internal reference to the jQuery plugin, because in noConflict mode you can never expect to be defined on the jQuery object
mdo added a commit that referenced this issue May 1, 2014
Fix #11464 - JS noConflict() mode not working in 3.0.x
@mdo mdo mentioned this issue May 1, 2014
1000hz pushed a commit to 1000hz/bootstrap-validator that referenced this issue May 22, 2014
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

3 participants