Last change
on this file since 619 was
619,
checked in by ramonb, 15 years ago
|
lib/:
- added new AJAX dependancies: ExtJS, pChart, Lightbox2
|
File size:
965 bytes
|
Line | |
---|
1 | /* |
---|
2 | * Ext JS Library 0.30 |
---|
3 | * Copyright(c) 2006-2009, Ext JS, LLC. |
---|
4 | * licensing@extjs.com |
---|
5 | * |
---|
6 | * http://extjs.com/license |
---|
7 | */ |
---|
8 | |
---|
9 | /** |
---|
10 | * @class Ext.air.NativeObservable |
---|
11 | * @extends Ext.util.Observable |
---|
12 | * |
---|
13 | * Adds ability for Ext Observable functionality to proxy events for native (AIR) object wrappers |
---|
14 | * |
---|
15 | * @constructor |
---|
16 | */ |
---|
17 | |
---|
18 | Ext.air.NativeObservable = Ext.extend(Ext.util.Observable, { |
---|
19 | addListener : function(name){ |
---|
20 | this.proxiedEvents = this.proxiedEvents || {}; |
---|
21 | if(!this.proxiedEvents[name]){ |
---|
22 | var instance = this; |
---|
23 | var f = function(){ |
---|
24 | var args = Array.prototype.slice.call(arguments, 0); |
---|
25 | args.unshift(name); |
---|
26 | instance.fireEvent.apply(instance, args); |
---|
27 | }; |
---|
28 | this.proxiedEvents[name] = f; |
---|
29 | this.getNative().addEventListener(name, f); |
---|
30 | } |
---|
31 | Ext.air.NativeObservable.superclass.addListener.apply(this, arguments); |
---|
32 | } |
---|
33 | }); |
---|
34 | |
---|
35 | Ext.air.NativeObservable.prototype.on = Ext.air.NativeObservable.prototype.addListener; |
---|
Note: See
TracBrowser
for help on using the repository browser.