0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Update tooltip.js

Don't reference `Tether` via attachment to `window`, with the update one can import bootstrap providing the dependencies in webpack with:

```
new webpack.ProvidePlugin({
  $: 'jquery',
  jQuery: 'jquery',
  Tether: 'tether',
});
```

Then inside one's own bootstrap/globals, `import 'bootstrap';` will simply work, and $/jQuery can be used from there.

I had wanted to do this, but also expose jQuery, Tether, etc when in development build in my code, but if I provide `window.Tether`, I can't then expose it to the outside...
This commit is contained in:
Michael J. Ryan 2016-03-14 13:18:08 -07:00
parent 5f959f1192
commit 1a23279237

View File

@ -16,7 +16,7 @@ const Tooltip = (($) => {
* Check for Tether dependency
* Tether - http://github.hubspot.com/tether/
*/
if (window.Tether === undefined) {
if ('undefined' === typeof Tether) {
throw new Error('Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)')
}