Add delegate and undelegate methods to View

Backbone allows delegating and undelegating single events on view classes as stated in the [annotated source](http://backbonejs.org/docs/backbone.html#section-163). This pull requests add the two methods to the View class.
This commit is contained in:
Sebastian Lenz
2015-11-02 22:38:51 +01:00
parent 0dd29bf825
commit 6748bfa488

View File

@@ -367,7 +367,9 @@ declare module Backbone {
remove(): View<TModel>;
make(tagName: any, attributes?: any, content?: any): any;
delegateEvents(events?: EventsHash): any;
delegate(eventName: string, selector: string, listener: Function): View<TModel>;
undelegateEvents(): any;
undelegate(eventName: string, selector?: string, listener?: Function): View<TModel>;
_ensureElement(): void;
}