UNPKG

1.4 kBTypeScriptView Raw
1import * as Backbone from 'backbone';
2export declare class NativeView<T extends Backbone.Model> extends Backbone.View<T> {
3 _removeElement(): void;
4 _setElement(element: HTMLElement): void;
5 _setAttributes(attrs: Backbone.ObjectHash): void;
6 /**
7 * Make an event delegation handler for the given `eventName` and `selector`
8 * and attach it to `this.el`.
9 * If selector is empty, the listener will be bound to `this.el`. If not, a
10 * new handler that will recursively traverse up the event target's DOM
11 * hierarchy looking for a node that matches the selector. If one is found,
12 * the event's `delegateTarget` property is set to it and the return the
13 * result of calling bound `listener` with the parameters given to the
14 * handler.
15 *
16 * This does not properly handle selectors for things like focus and blur (see
17 * https://github.com/jquery/jquery/blob/7d21f02b9ec9f655583e898350badf89165ed4d5/src/event.js#L442
18 * for some similar exceptional cases).
19 */
20 delegate(eventName: string, listener: Function): this;
21 delegate(eventName: string, selector: string, listener: Function): this;
22 undelegate(eventName: string, selector?: string, listener?: Function): this;
23 undelegate(selector: string, listener?: Function): this;
24 undelegateEvents(): this;
25 private _domEvents;
26}
27//# sourceMappingURL=nativeview.d.ts.map
\No newline at end of file