Skip to content

Instantly share code, notes, and snippets.

@jmahc
Created May 13, 2016 19:38
Show Gist options
  • Save jmahc/23db49699f3cc44cc3358910e1b83539 to your computer and use it in GitHub Desktop.
Save jmahc/23db49699f3cc44cc3358910e1b83539 to your computer and use it in GitHub Desktop.
Bootstrap v4.0.0-alpha.2, window.Tether, tooltip error, Tether error, bootstrap, tether, requirejs, require.js
document.addEventListener("DOMContentLoaded", function() {
/*
==========================================
May 13, 2016
github.com/jmahc
---
require.js with Bootstrap v4.0.0-alpha.2
Even if you aren't using the tooltips...
Get rid of the console error using this! :)
---
---
window.Tether, tooltip error, Tether error, bootstrap, tether, requirejs, require.js
==========================================
*/
requirejs.config({
baseUrl: '/js/lib',
paths: {
// In order of need
jquery: 'jquery.min',
tether: 'tether.min',
bootstrap: 'bootstrap.min',
},
shim: {
'bootstrap': {
deps: ['tether', 'jquery' ]
}
}
});
function init() {
require(['jquery'], function ($) {
$(function() {
require(['tether'], function(Tether) {
window.Tether = Tether;
return Tether;
});
require(['bootstrap'], function() {
$('[data-toggle="tooltip"]').tooltip();
});
});
});
};
init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment