Skip to content

Commit

Permalink
Fixing some build-module-v4.js scripting
Browse files Browse the repository at this point in the history
  • Loading branch information
thednp committed Jan 21, 2019
1 parent 71d8eaf commit 159fece
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build-module-v4.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = (options) => {

function wrap(main) {
var utils = fs.readFileSync(`${libPath}/V4/utils.js`, 'utf8').split('\n').join('\n ');
var init = options.autoInitDataAPI === false ? '' : options.noInitDataAPI ? '' : fs.readFileSync(`${libPath}/V4/utils-init.js`, 'utf8').split('\n').join('\n ');
var init = options.autoInitDataAPI === false ? '' : fs.readFileSync(`${libPath}/V4/utils-init.js`, 'utf8').split('\n').join('\n ');
main = main.split('\n').join('\n ');
// Initialize arrays:
// Arrays will be used in the template literal below
Expand Down
1 change: 1 addition & 0 deletions build-v4.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var argv = require('yargs')
},
autoInitDataAPI: {
type: 'boolean',
default: true,
describe: 'Include the auto-initialization utility in the bundle'
}
})
Expand Down
1 change: 1 addition & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var argv = require('yargs')
},
autoInitDataAPI: {
type: 'boolean',
default: true,
describe: 'Include the auto-initialization utility in the bundle'
}
})
Expand Down
17 changes: 17 additions & 0 deletions dist/bootstrap-native-v4.js
Original file line number Diff line number Diff line change
Expand Up @@ -1871,6 +1871,23 @@
supports[push]( [ stringTooltip, Tooltip, '['+dataToggle+'="tooltip"]' ] );



/* Native Javascript for Bootstrap 4 | Initialize Data API
--------------------------------------------------------*/
var initializeDataAPI = function( constructor, collection ){
for (var i=0, l=collection[length]; i<l; i++) {
new constructor(collection[i]);
}
},
initCallback = BSN.initCallback = function(lookUp){
lookUp = lookUp || DOC;
for (var i=0, l=supports[length]; i<l; i++) {
initializeDataAPI( supports[i][1], lookUp[querySelectorAll] (supports[i][2]) );
}
};

// bulk initialize all components
DOC[body] ? initCallback() : on( DOC, 'DOMContentLoaded', function(){ initCallback(); } );

return {
Alert: Alert,
Expand Down
2 changes: 1 addition & 1 deletion dist/bootstrap-native-v4.min.js

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions dist/bootstrap-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,23 @@
supports[push]( [ stringTooltip, Tooltip, '['+dataToggle+'="tooltip"]' ] );



/* Native Javascript for Bootstrap 3 | Initialize Data API
--------------------------------------------------------*/
var initializeDataAPI = function( constructor, collection ){
for (var i=0, l=collection[length]; i<l; i++) {
new constructor(collection[i]);
}
},
initCallback = BSN.initCallback = function(lookUp){
lookUp = lookUp || DOC;
for (var i=0, l=supports[length]; i<l; i++) {
initializeDataAPI( supports[i][1], lookUp[querySelectorAll] (supports[i][2]) );
}
};

// bulk initialize all components
DOC[body] ? initCallback() : on( DOC, 'DOMContentLoaded', function(){ initCallback(); } );

return {
Affix: Affix,
Expand Down
2 changes: 1 addition & 1 deletion dist/bootstrap-native.min.js

Large diffs are not rendered by default.

0 comments on commit 159fece

Please sign in to comment.