How do I use Twitter bootstrap in browserify? I installed bootstrap-browserify, and tried using this in my code
Later in my code, I have some code trying to patch the modal dialog function of bootstrap, but it throws an error.
This is how my code looks like:
var bootstrap = require('bootstrap-browserify');
$(document).ready(function () {
$.fn.modal.Constructor.prototype.enforceFocus = function () {
var that = this;
$(document).on('focusin.modal', function (e) {
if ($(e.target).hasClass('select2-input')) {
return true;
}
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
that.$element.focus();
}
});
};
}
I am completely new to browserify and I am using it for the first time. What am I doing wrong?