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

Tooltip noconflict mode doesn't work #7385

Closed
adiktofsugar opened this issue Mar 25, 2013 · 1 comment
Closed

Tooltip noconflict mode doesn't work #7385

adiktofsugar opened this issue Mar 25, 2013 · 1 comment

Comments

@adiktofsugar
Copy link

I suspect most of the plugins don't work with noconflict mode, but I haven't tested them.

I have bootstrap and jquery ui on the same page. jQuery ui starts, and creates $.fn.tooltip. Then bootstrap starts and overwrites it, then I do:

$.fn.bsTooltip = $.fn.tooltip.noConflict();
$('.my-element').bsTooltip()

But, because of this:

$.fn.tooltip = function ( option ) {
  return this.each(function () {
    var $this = $(this)
      , data = $this.data('tooltip') // HARDCODED TOOLTIP STRING
      , options = typeof option == 'object' && option
    if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
    if (typeof option == 'string') data[option]()
  })
}

and this:

var Tooltip = function (element, options) {
    this.init('tooltip', element, options) // HARDCODED TOOLTIP STRING
}

It fails, because the getOptions function is getting everything based on the this.type, which is set by the Tooltip class as 'tooltip'...including the tooltip data, but that's hardcoded to 'tooltip' in the first code block.

@cvrebert
Copy link
Collaborator

Duplicate of #6303. Fixing noConflict is on the roadmap for v3.

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