You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2007/09/24 18:30:57 UTC

svn commit: r578872 - /myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ApacheChart.js

Author: matzew
Date: Mon Sep 24 09:30:56 2007
New Revision: 578872

URL: http://svn.apache.org/viewvc?rev=578872&view=rev
Log:
TRINIDAD-732 - JS clean-up: ApacheChart should use TrUtils for creating the callback

Modified:
    myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ApacheChart.js

Modified: myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ApacheChart.js
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ApacheChart.js?rev=578872&r1=578871&r2=578872&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ApacheChart.js (original)
+++ myfaces/trinidad/trunk/trinidad/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/ApacheChart.js Mon Sep 24 09:30:56 2007
@@ -45,22 +45,6 @@
   extendingClass.superclass = baseClass.prototype;
 }
 
-ApacheChartObj.prototype.createCallback = function(func)
-{
-  // create a function that sets up "this" and delegates all of the parameters
-  // to the passed in function
-  var proxyFunction = new Function(
-    "var f=arguments.callee; return f._func.apply(f._owner, arguments);");
-
-  // attach ourselves as "this" to the created function
-  proxyFunction._owner = this;
-
-  // attach function to delegate to
-  proxyFunction._func = func;
-
-  return proxyFunction;
-}
-
 /**
 * Asserts arg is true; else throws error with msg.
 */
@@ -695,10 +679,10 @@
   }
   if(this._tooltipsVisible)
   {
-    this.ShowToolTipCallback = this.createCallback(this.ShowToolTip);
-    this.HideToolTipCallback = this.createCallback(this.HideToolTip);
+    this.ShowToolTipCallback = TrUIUtils.createCallback(this, this.ShowToolTip);
+    this.HideToolTipCallback = TrUIUtils.createCallback(this, this.HideToolTip);
   }
-  this.ClickCallback = this.createCallback(this.Click);
+  this.ClickCallback = TrUIUtils.createCallback(this, this.Click);
   
   // Note the ordering is important. The grid takes the space after the title etc.
   this.DrawBorder();
@@ -761,7 +745,7 @@
     }
 
     if(!this._drawCallback)
-      this._drawCallback = this.createCallback(this.draw);
+      this._drawCallback = TrUIUtils.createCallback(this, this.draw);
     // Lets try again
     window.setTimeout(this._drawCallback, ApacheChart._SVGCHECK_INTERVAL);
     return false;
@@ -804,7 +788,7 @@
   if(animateDuration > 0)
   {
     if(this._animCallback == null)
-       this._animCallback = this.createCallback(this.DoAnimation);
+       this._animCallback = TrUIUtils.createCallback(this, this.DoAnimation);
     this._startTime = (new Date()).getTime();
     this._intervalId = window.setInterval(this._animCallback, ApacheChart._ANIMATE_INTERVAL);
   }