Skip to content
Permalink
Browse files

Demos: bootstrap needs to account for widgets folder

Ref #13885
  • Loading branch information
arschmitz committed Jul 21, 2015
1 parent 37602d7 commit e6dbcd9f30351d6b27464713f5f6b962e51a3180
Showing with 18 additions and 0 deletions.
  1. +18 −0 demos/bootstrap.js
@@ -24,6 +24,22 @@ var effectsAll = [
"effect-size",
"effect-slide"
];
var widgets = [];

function getPath( module ) {
for ( var i = 0; i < widgets.length; i++ ) {
if ( widgets[ i ] === module ) {
return "widgets/" + module;
}
}
return module;
}
function fixPaths( modules ) {
for ( var i = 0; i < modules.length; i++ ) {
modules[ i ] = getPath( modules[ i ] );
}
return modules;
}

// Hide the page while things are loading to prevent a FOUC
document.documentElement.className = "demo-loading";
@@ -40,13 +56,15 @@ require.config( {
}
} );


// Replace effects all shortcut modules with all the effects modules
if ( modules && modules.indexOf( "effects-all" ) !== -1 ) {
modules = modules.replace( /effects-all/, effectsAll.join( " " ) );
}

modules = modules ? modules.replace( /^\s+|\s+$/g, "" ).split( /\s+/ ) : [];
modules.push( pathParts[ pathParts.length - 2 ] );
modules = fixPaths( modules );

require( modules, function() {
var newScript = document.createElement( "script" );

0 comments on commit e6dbcd9

Please sign in to comment.
You can’t perform that action at this time.