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

Conflict with Jquery UI in $.button #5301

Closed
Atorich opened this issue Sep 26, 2012 · 2 comments
Closed

Conflict with Jquery UI in $.button #5301

Atorich opened this issue Sep 26, 2012 · 2 comments
Labels

Comments

@Atorich
Copy link

Atorich commented Sep 26, 2012

In some case when jquery-ui.js is loaded after bootstrap.js, this code

    $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
      var $btn = $(e.target)
      if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
      $btn.button('toggle')
    })

has no effect.

$.fn.button in console shows a bit of jquery-ui, not bootstrap.js method.

I've solved this problem:

    $.fn.button_ = $.fn.button;

and

    $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
      var $btn = $(e.target)
      if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
      $btn.button_('toggle')
    })
@fat
Copy link
Member

fat commented Oct 18, 2012

jquery-ui and bootstrap don't play nicely together.

@fat fat closed this as completed Oct 18, 2012
@Atorich
Copy link
Author

Atorich commented Oct 19, 2012

ok

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

No branches or pull requests

2 participants