Merge remote-tracking branch 'origin/master' into Astro

This commit is contained in:
斟酌 鵬兄 2016-05-09 15:52:10 +08:00
commit 1d17093c45

View File

@ -9,6 +9,8 @@
/** @type {Dandelion} */ /** @type {Dandelion} */
var Dand = __import( "Dandelion" ); var Dand = __import( "Dandelion" );
var LoadedClasses = {};
var loadFile = function ( sapi, request, mode ) var loadFile = function ( sapi, request, mode )
{ {
var head = Dand.tag( "head" )[0]; var head = Dand.tag( "head" )[0];
@ -59,13 +61,13 @@
for( var i in classes ) for( var i in classes )
{ {
var c = classes[i]; var c = classes[i];
if( excludes.indexOf( c ) == -1 ) if( ~excludes.indexOf( c ) || LoadedClasses[ c ] )
{ {
needed.push( c ); handler( c );
} }
else else
{ {
handler( c ); needed.push( c );
} }
} }
@ -84,7 +86,15 @@
); );
BotanJS.addEventListener( "NS_INIT", onLoad ); BotanJS.addEventListener( "NS_INIT", onLoad );
BotanJS.addEventListener( "NS_EXPORT", onLoad );
BotanJS.addEventListener( "NS_EXPORT", function( e )
{
if( e.data.name )
{
LoadedClasses[ e.data.name ] = 1;
}
onLoad( e );
} );
}; };
}; };