OSDN Git Service

Fix the bug of X.NodeAnime.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 17_ExecuteAtEnd.js
1
2 var ExecuteAtEnd_CALLBACKS = [];
3
4 function ExecuteAtEnd_add( func ){
5         ExecuteAtEnd_CALLBACKS[ ExecuteAtEnd_CALLBACKS.length ] = func;
6 };
7
8 function ExecuteAtEnd_onEnd(){
9         var i = -1, func;
10         
11         if( !ExecuteAtEnd_CALLBACKS.length ) return;
12         
13         while( func = ExecuteAtEnd_CALLBACKS[ ++i ] ){
14                 func();
15         };
16         ExecuteAtEnd_CALLBACKS.length = 0;
17 };