X-Git-Url: http://git.osdn.jp/view?p=pettanr%2FclientJs.git;a=blobdiff_plain;f=0.6.x%2Fjs%2F01_core%2F17_ExecuteAtEnd.js;fp=0.6.x%2Fjs%2F01_core%2F17_ExecuteAtEnd.js;h=624eb9d2c8ce856a75bb8cd9cca749174b5e005b;hp=0000000000000000000000000000000000000000;hb=604668ba9efa027d4bc77fd8020d6b6be55d03e1;hpb=ef25747bebf1799d49f9bd0d64e339da9ea61d13 diff --git a/0.6.x/js/01_core/17_ExecuteAtEnd.js b/0.6.x/js/01_core/17_ExecuteAtEnd.js new file mode 100644 index 0000000..624eb9d --- /dev/null +++ b/0.6.x/js/01_core/17_ExecuteAtEnd.js @@ -0,0 +1,17 @@ + +var ExecuteAtEnd_CALLBACKS = []; + +function ExecuteAtEnd_add( func ){ + ExecuteAtEnd_CALLBACKS[ ExecuteAtEnd_CALLBACKS.length ] = func; +}; + +function ExecuteAtEnd_onEnd(){ + var i = -1, func; + + if( !ExecuteAtEnd_CALLBACKS.length ) return; + + while( func = ExecuteAtEnd_CALLBACKS[ ++i ] ){ + func(); + }; + ExecuteAtEnd_CALLBACKS.length = 0; +};