OSDN Git Service

Version 0.6.222, Fix the bug of X.TextRange.
[pettanr/clientJs.git] / 0.6.x / js / 01_core / 17_ExecuteAtEnd.js
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 (file)
index 0000000..624eb9d
--- /dev/null
@@ -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;
+};