4

This is a well-known problem with references here: Jquery and Bootstrap have naming conflict for tooltip()

The solution many have suggested is to use $.widget.bridge before Bootstrap is loaded. But in my case, I do not know how to achieve it using requireJS style:

My script import look like this:

define(['jquery', 'jquery-ui', 'knockout', 'bootsrap'],
Cœur
  • 37,241
  • 25
  • 195
  • 267
Loredra L
  • 1,485
  • 2
  • 16
  • 32

1 Answers1

0

Well, this is an old unanswered question. Since I stumbled over it when I had the same problem, here is how I solved it:

require.config({
  shim: {
    'bootstrap': {
      deps: ['jquery', 'jquery-ui'],
      callback: function($) {
        $.widget.bridge('uitooltip', $.ui.tooltip);
      }
    }
  }
});

This forces requireJS to load jQuery UI and implement the bridge before bootstrap is loaded.

This might be considered a dirty workaround. However, since this code snippet configures how the different dependencies are loaded and solves a conflict between two dependencies, I think this is a good place for that line of code to live.

Tekay37
  • 467
  • 5
  • 18