Created
May 13, 2016 19:38
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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