diff --git a/ionic/animations/scroll-to.ts b/ionic/animations/scroll-to.ts index 923beed105..c80516356d 100644 --- a/ionic/animations/scroll-to.ts +++ b/ionic/animations/scroll-to.ts @@ -23,7 +23,7 @@ export class ScrollTo { } } - start(x, y, duration, tolerance): Promise { + start(x: number, y: number, duration: number, tolerance?: number): Promise { // scroll animation loop w/ easing // credit https://gist.github.com/dezinezync/5487119 let self = this; diff --git a/ionic/components/content/content.ts b/ionic/components/content/content.ts index 145169921b..4ddb68d26b 100644 --- a/ionic/components/content/content.ts +++ b/ionic/components/content/content.ts @@ -213,7 +213,7 @@ export class Content { * @param {TODO} tolerance TODO * @returns {Promise} Returns a promise when done */ - scrollTo(x, y, duration, tolerance) { + scrollTo(x: number, y: number, duration: number, tolerance?: number): Promise { if (this._scrollTo) { this._scrollTo.dispose(); } diff --git a/ionic/components/input/input.ts b/ionic/components/input/input.ts index 1bded24197..68da16ca99 100644 --- a/ionic/components/input/input.ts +++ b/ionic/components/input/input.ts @@ -74,11 +74,20 @@ import {Icon} from '../icon/icon'; directives: [NgIf, forwardRef(() => InputScrollAssist), TextInput, Button] }) export class ItemInput { - /** - * @private - */ - @Input() clearInput: any; + private _assist: boolean; + private input: TextInput; + private label: Label; + private scrollMove: EventListener; + private startCoord: {x: number, y: number}; + private deregScroll: () => void; + + keyboardHeight: number; value: string = ''; + type: string = null; + lastTouch: number = 0; + displayType: string; + + @Input() clearInput: any; constructor( config: Config, @@ -96,10 +105,7 @@ export class ItemInput { ) { _form.register(this); - this.type = null; - this.lastTouch = 0; - - // make more gud with pending @Attributes API + //TODO make more gud with pending @Attributes API this.displayType = (isFloating === '' ? 'floating' : (isStacked === '' ? 'stacked' : (isFixed === '' ? 'fixed' : (isInset === '' ? 'inset' : null)))); this._assist = config.get('scrollAssist'); @@ -110,7 +116,7 @@ export class ItemInput { * @private */ @ContentChild(TextInput) - set _setInput(textInput) { + set _setInput(textInput: TextInput) { if (textInput) { textInput.addClass('item-input'); if (this.displayType) { @@ -135,7 +141,7 @@ export class ItemInput { * @private */ @ContentChild(Label) - set _setLabel(label) { + set _setLabel(label: Label) { if (label && this.displayType) { label.addClass(this.displayType + '-label'); } @@ -187,7 +193,7 @@ export class ItemInput { self.input.labelledBy(self.label.id); } - self.scrollMove = function(ev) { + self.scrollMove = function(ev: UIEvent) { if (!(self._nav && self._nav.isTransitioning())) { self.deregMove(); diff --git a/ionic/components/label/label.ts b/ionic/components/label/label.ts index 5ceaba3d38..928666bd8a 100644 --- a/ionic/components/label/label.ts +++ b/ionic/components/label/label.ts @@ -1,4 +1,4 @@ -import {Directive, ElementRef, Renderer} from 'angular2/core'; +import {Directive, ElementRef, Renderer, Input} from 'angular2/core'; import {Form} from '../../util/form'; @@ -23,14 +23,12 @@ import {Form} from '../../util/form'; @Directive({ selector: 'ion-label', - inputs: [ - 'id' - ], host: { '[attr.id]': 'id' } }) export class Label { + @Input() id: string; constructor( private _form: Form, diff --git a/ionic/util/dom.ts b/ionic/util/dom.ts index 8d3a833650..c3620abcc6 100644 --- a/ionic/util/dom.ts +++ b/ionic/util/dom.ts @@ -155,7 +155,7 @@ export function windowLoad(callback) { return promise; } -export function pointerCoord(ev) { +export function pointerCoord(ev): {x: number, y: number} { // get coordinates for either a mouse click // or a touch depending on the given event let c = { x: 0, y: 0 };