Merge branch 'jonathanhedren-master'

This commit is contained in:
vvakame
2014-06-05 11:08:14 +09:00
2 changed files with 23 additions and 5 deletions
+7 -3
View File
@@ -4,8 +4,12 @@ declare var els: Element[];
declare var mixinFn: Function;
function TestComponent() {
var self: Flight.Component = this;
var self: Flight.Component = this;
self.attributes({
fooSelector: '.bar'
});
self.defaultAttrs({
fooSelector: '.bar'
});
@@ -14,7 +18,7 @@ function TestComponent() {
var el: HTMLElement = data.el;
self.select('fooSelector').addClass('bar');
};
self.around('initialize', function () { });
self.before('initialize', function () { });
self.after("initialize", function () {
+16 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Flight 1.1.1
// Type definitions for Flight 1.1.4
// Project: http://flightjs.github.com/flight/
// Definitions by: Jonathan Hedrén <https://github.com/jonathanhedren/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -9,10 +9,25 @@ declare module Flight {
export interface Base {
/**
* Most Components and Mixins need to define attributes. In Flight,
* default values are assigned by passing an object to the attributes
* function.
*
* NOTE: this.attributes replaces the now deprecated this.defaultAttrs.
* However, for backwards compatibility, if you are using this.defaultAttrs
* then all the old attribute behavior remains in place.
*/
attributes(obj: Object): void;
/**
* Most Components and Mixins need to define attributes. In Flight,
* default values are assigned by passing an object to the defaultAttrs
* function.
*
* NOTE: this.attributes replaces the now deprecated this.defaultAttrs.
* However, for backwards compatibility, if you are using this.defaultAttrs
* then all the old attribute behavior remains in place.
*/
defaultAttrs(obj: Object): void;
@@ -181,7 +196,6 @@ declare module Flight {
$node: JQuery;
}
export interface AdviceStatic {
withAdvice(): Function;
}