Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / NativeObservable.html
diff --git a/docs/source/NativeObservable.html b/docs/source/NativeObservable.html
new file mode 100644 (file)
index 0000000..21dc006
--- /dev/null
@@ -0,0 +1,36 @@
+<html>\r
+<head>\r
+  <title>The source code</title>\r
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js"><div id="cls-Ext.air.NativeObservable"></div>/**\r
+ * @class Ext.air.NativeObservable\r
+ * @extends Ext.util.Observable\r
+ * \r
+ * Adds ability for Ext Observable functionality to proxy events for native (AIR) object wrappers\r
+ * \r
+ * @constructor\r
+ */\r
+\r
+Ext.air.NativeObservable = Ext.extend(Ext.util.Observable, {\r
+       addListener : function(name){\r
+               this.proxiedEvents = this.proxiedEvents || {};\r
+               if(!this.proxiedEvents[name]){\r
+                       var instance = this;\r
+                       var f = function(){\r
+                               var args = Array.prototype.slice.call(arguments, 0);\r
+                               args.unshift(name);\r
+                               instance.fireEvent.apply(instance, args);\r
+                       };\r
+                       this.proxiedEvents[name] = f;\r
+                       this.getNative().addEventListener(name, f);\r
+               }\r
+               Ext.air.NativeObservable.superclass.addListener.apply(this, arguments);\r
+       }\r
+});\r
+\r
+Ext.air.NativeObservable.prototype.on = Ext.air.NativeObservable.prototype.addListener;</pre>    \r
+</body>\r
+</html>
\ No newline at end of file