Reputation: 805
I would like to use SASS version of Bootstrap 3, but the JS modules not working.
My bootstrap.js:
//= require bootstrap/affix
//= require bootstrap/alert
//= require bootstrap/button
//= require bootstrap/carousel
//= require bootstrap/collapse
//= require bootstrap/dropdown
//= require bootstrap/tab
//= require bootstrap/transition
//= require bootstrap/scrollspy
//= require bootstrap/modal
//= require bootstrap/tooltip
//= require bootstrap/popover
What is require
and how does it work? I never seen that before with the normal
bootstrap.
Upvotes: 0
Views: 244
Reputation: 68790
This is a javascript manifest, which is used by Rails to load Bootstrap plugins.
With this manifest, you can quickly disable a single plugin.
If you don't use Rails, you have 2 options :
<script src="assets/js/bootstrap/affix.js"></script>
<script src="assets/js/bootstrap/alert.js"></script>
<script src="assets/js/bootstrap/button.js"></script>
...
bootstrap.js
You can find it on Bootstrap CDN :
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
(Include the distant script, or copy/paste it into you project)
Upvotes: 1
Reputation: 495
I came across the same issue with them partials, I'd recommend you roll Bootstrap 3 out in a separate minified BS3 File, however if you wish to keep them in partials use the following in a separate Javascript file...
var includeFiles = [
'affix',
'alert',
'button',
'carousel',
'collapse',
'dropdown',
'tab',
'transition',
'scrollspy',
'modal',
'tooltip',
'popover'
];
for(var i=0; i < includeFiles.length; i++) {
$('body').append($('<script src="partials/'+includeFiles[i]+'"></script>'));
}
Of course the Path inside the .append method is entirely dependant on your file structure, please edit that to suit your needs.
However if you really want to work with those require statements, then use the Rails Framework you can read on that at http://rubyonrails.org/
Upvotes: 0