event handling names are now DOM2 compatible

This commit is contained in:
Stanimir Karoserov
2014-06-11 16:06:19 +03:00
parent 67d440f59b
commit aeadff59e5

View File

@ -24,15 +24,15 @@ export class Observable {
public on: (eventNames: string, callback: (data: EventData) => void) => void; public on: (eventNames: string, callback: (data: EventData) => void) => void;
public off: (eventNames: string, callback?: any) => void; public off: (eventNames: string, callback?: any) => void;
public addListener: (eventNames: string, callback: (data: EventData) => void) => void; public addEventListener: (eventNames: string, callback: (data: EventData) => void) => void;
public removeListener: (eventNames: string, callback?: any) => void; public removeEventListener: (eventNames: string, callback?: any) => void;
// true to track the Changing phase, false otherwise // true to track the Changing phase, false otherwise
private _trackChanging = false; private _trackChanging = false;
constructor(body?: any) { constructor(body?: any) {
this.on = this.addListener = this.addObserver; this.on = this.addEventListener = this.addObserver;
this.off = this.removeListener = this.removeObserver; this.off = this.removeEventListener = this.removeObserver;
} }
public addObserver(eventNames: string, callback: (data: EventData) => void) { public addObserver(eventNames: string, callback: (data: EventData) => void) {