From 1a23279237b5360dab15d91aac85cbf8306e560a Mon Sep 17 00:00:00 2001 From: "Michael J. Ryan" Date: Mon, 14 Mar 2016 13:18:08 -0700 Subject: [PATCH 1/2] 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... --- js/src/tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 77803dc402ad..03d9e4cc8e89 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -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/)') } From 681d390a0504c7a1c855a6eb052ea70409e41cde Mon Sep 17 00:00:00 2001 From: "Michael J. Ryan" Date: Mon, 14 Mar 2016 13:29:03 -0700 Subject: [PATCH 2/2] Update tooltip.js match project's style check --- js/src/tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 03d9e4cc8e89..b98a56134945 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -16,7 +16,7 @@ const Tooltip = (($) => { * Check for Tether dependency * Tether - http://github.hubspot.com/tether/ */ - if ('undefined' === typeof Tether) { + if (typeof Tether === 'undefined') { throw new Error('Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)') }