X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/docs/source/NativeObservable.html diff --git a/docs/source/NativeObservable.html b/docs/source/NativeObservable.html new file mode 100644 index 00000000..21dc0063 --- /dev/null +++ b/docs/source/NativeObservable.html @@ -0,0 +1,36 @@ + + + The source code + + + + +
/** + * @class Ext.air.NativeObservable + * @extends Ext.util.Observable + * + * Adds ability for Ext Observable functionality to proxy events for native (AIR) object wrappers + * + * @constructor + */ + +Ext.air.NativeObservable = Ext.extend(Ext.util.Observable, { + addListener : function(name){ + this.proxiedEvents = this.proxiedEvents || {}; + if(!this.proxiedEvents[name]){ + var instance = this; + var f = function(){ + var args = Array.prototype.slice.call(arguments, 0); + args.unshift(name); + instance.fireEvent.apply(instance, args); + }; + this.proxiedEvents[name] = f; + this.getNative().addEventListener(name, f); + } + Ext.air.NativeObservable.superclass.addListener.apply(this, arguments); + } +}); + +Ext.air.NativeObservable.prototype.on = Ext.air.NativeObservable.prototype.addListener;
+ + \ No newline at end of file