mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added som tests. Updated definitions.
This commit is contained in:
+48
-1
@@ -1 +1,48 @@
|
||||
/// <reference path="flight.d.ts" />
|
||||
/// <reference path="flight.d.ts" />
|
||||
declare var el: Element;
|
||||
declare var els: Element[];
|
||||
declare var mixinFn: Function;
|
||||
|
||||
function TestComponent() {
|
||||
var self: FlightBase = this;
|
||||
|
||||
self.defaultAttrs({
|
||||
fooSelector: '.bar'
|
||||
});
|
||||
|
||||
this.onClick = function (ev: JQueryEventObject, data) {
|
||||
self.select('fooSelector').addClass('bar');
|
||||
};
|
||||
|
||||
self.around('initialize', function () { });
|
||||
self.before('initialize', function () { });
|
||||
self.after("initialize", function () {
|
||||
|
||||
var $node: JQuery = self.$node;
|
||||
var node: Element = self.node;
|
||||
|
||||
self.on(el, 'click', {});
|
||||
self.on(els, 'click', function () { });
|
||||
self.on(document, 'click', this.onClick);
|
||||
self.on('click', function () { });
|
||||
self.on('click', {
|
||||
fooSelector: this.onClick
|
||||
});
|
||||
|
||||
self.off('click', function () { });
|
||||
self.off(document, 'click');
|
||||
self.off(el, 'click')
|
||||
self.off(els, 'click');
|
||||
|
||||
self.teardown();
|
||||
});
|
||||
}
|
||||
|
||||
flight.component(TestComponent, mixinFn).attachTo(el);
|
||||
flight.component(TestComponent, mixinFn).attachTo($(els));
|
||||
flight.component(TestComponent, mixinFn).attachTo('.test');
|
||||
flight.component(TestComponent, mixinFn).attachTo('.test', {
|
||||
some: 'data'
|
||||
});
|
||||
|
||||
flight.component.teardownAll();
|
||||
|
||||
Reference in New Issue
Block a user