src/js/utils.js
branchpopcorn-port
changeset 73 a8192c57c87d
parent 60 ffc038fdb8f1
child 78 d77fe3283530
--- a/src/js/utils.js	Thu Oct 13 17:10:35 2011 +0200
+++ b/src/js/utils.js	Thu Oct 13 17:11:20 2011 +0200
@@ -4,13 +4,25 @@
 
 IriSP.traceNum = 0;
 IriSP.trace = function( msg, value ) {
-
+/*
 	if( IriSP.config.gui.debug === true ) {
 		IriSP.traceNum += 1;
 		IriSP.jQuery( "<div>"+IriSP.traceNum+" - "+msg+" : "+value+"</div>" ).appendTo( "#Ldt-output" );
 	}
+*/
 };
 
+/* used in callbacks - because in callbacks we lose "this",
+   we need to have a special function which wraps "this" in 
+   a closure. This way, the 
+*/   
+IriSP.wrap = function (obj, fn) {
+  return function() {
+    args = [].slice.call(this, arguments);
+    fn.call(obj, args);
+  }
+}
+
 /* for ie compatibility
 if (Object.prototype.__defineGetter__&&!Object.defineProperty) {
    Object.defineProperty=function(obj,prop,desc) {