more docs

This commit is contained in:
Tim Lancina
2015-08-28 15:57:55 -07:00
parent 5b72ff1114
commit 68c27c36a9
5 changed files with 87 additions and 27 deletions

View File

@ -93,18 +93,19 @@ export class Content extends Ion {
/**
* Returns the content and scroll elements' dimensions.
* @returns {Object} dimensions The content and scroll elements' dimensions
* @returns {Number} dimensions.contentHeight content offsetHeight
* @returns {Number} dimensions.contentTop content offsetTop
* @returns {Number} dimensions.contentBottom content offsetTop+offsetHeight
* @returns {Number} dimensions.contentWidth content offsetWidth
* @returns {Number} dimensions.contentLeft content offsetLeft
* @returns {Number} dimensions.contentRight content offsetLeft + offsetWidth
* @returns {Number} dimensions.scrollHeight scroll scrollHeight
* @returns {Number} dimensions.scrollTop scroll scrollTop
* @returns {Number} dimensions.scrollBottom scroll scrollTop + scrollHeight
* @returns {Number} dimensions.scrollWidth scroll scrollWidth
* @returns {Number} dimensions.scrollLeft scroll scrollLeft
* @returns {Number} dimensions.scrollRight scroll scrollLeft + scrollWidth
* {Number} dimensions.contentHeight content offsetHeight
* {Number} dimensions.contentTop content offsetTop
* {Number} dimensions.contentBottom content offsetTop+offsetHeight
* {Number} dimensions.contentWidth content offsetWidth
* {Number} dimensions.contentLeft content offsetLeft
* {Number} dimensions.contentRight content offsetLeft + offsetWidth
* {Number} dimensions.scrollHeight scroll scrollHeight
* {Number} dimensions.scrollTop scroll scrollTop
* {Number} dimensions.scrollBottom scroll scrollTop + scrollHeight
* {Number} dimensions.scrollWidth scroll scrollWidth
* {Number} dimensions.scrollLeft scroll scrollLeft
* {Number} dimensions.scrollRight scroll scrollLeft + scrollWidth
* TODO: figure out how to get this to work
*/
getDimensions() {
let scrollElement = this.scrollElement;

View File

@ -5,7 +5,9 @@ import * as dom from '../../util/dom';
import {Platform} from '../../platform/platform';
import {IonInput} from './input';
/**
* TODO
*/
@Component({
selector: 'focus-holder'
})
@ -13,16 +15,27 @@ import {IonInput} from './input';
template: '<input tabindex="999"><input tabindex="1001"><input tabindex="1002">',
directives: [forwardRef(() => FocusInput)]
})
export class FocusHolder {
export class FocusHolder {
/**
* TODO
*/
constructor() {
this.i = [];
}
/**
* TODO
* @param {TODO} inputType TODO
*/
setFocusHolder(inputType) {
this.i[2].type = inputType;
this.i[2].setFocus();
}
/**
* TODO
* @param {TODO} tabIndex TODO
*/
receivedFocus(tabIndex) {
if (tabIndex === '999') {
// focus on the previous input
@ -34,6 +47,10 @@ export class FocusHolder {
}
}
/**
* TODO
* @param {TODO} input TODO
*/
register(input) {
this.i.push(input);
}
@ -79,4 +96,3 @@ class FocusInput {
this._t = val;
}
}

View File

@ -3,7 +3,9 @@ import {Directive} from 'angular2/angular2';
import {IonicConfig} from '../../config/config';
import {pointerCoord, hasPointerMoved} from '../../util/dom';
/**
* TODO
*/
@Directive({
selector: 'ion-label',
properties: [
@ -19,10 +21,18 @@ import {pointerCoord, hasPointerMoved} from '../../util/dom';
}
})
export class Label {
/**
* TODO
* @param {IonicConfig} config
*/
constructor(config: IonicConfig) {
this.scrollAssist = config.setting('keyboardScrollAssist');
}
/**
* TODO
* @param {TODO} ev TODO
*/
pointerStart(ev) {
if (this.scrollAssist) {
// remember where the touchstart/mousedown started
@ -30,6 +40,10 @@ export class Label {
}
}
/**
* TODO
* @param {TODO} ev TODO
*/
pointerEnd(ev) {
if (this.container) {

View File

@ -6,7 +6,9 @@ import {IonicDirective} from '../../config/annotations';
import {ListVirtualScroll} from './virtual';
import * as util from 'ionic/util';
/**
* TODO
*/
@IonicDirective({
selector: 'ion-list',
properties: [
@ -16,11 +18,18 @@ import * as util from 'ionic/util';
]
})
export class List extends Ion {
constructor(elementRef: ElementRef, ionicConfig: IonicConfig) {
super(elementRef, ionicConfig);
/**
* TODO
* @param {ElementRef} elementRef TODO
* @param {IonicConfig} config TODO
*/
constructor(elementRef: ElementRef, config: IonicConfig) {
super(elementRef, config);
this.ele = elementRef.nativeElement;
}
/**
* TODO
*/
onIonInit() {
if (util.isDefined(this.virtual)) {
console.log('Content', this.content);
@ -29,7 +38,10 @@ export class List extends Ion {
this._initVirtualScrolling();
}
}
/**
* @private
* TODO
*/
_initVirtualScrolling() {
if(!this.content) {
return;
@ -38,12 +50,18 @@ export class List extends Ion {
this._virtualScrollingManager = new ListVirtualScroll(this);
}
/**
* TODO
* @param {TODO} item TODO
*/
setItemTemplate(item) {
this.itemTemplate = item;
}
}
/**
* TODO
*/
@Directive({
selector: 'ion-header',
properties: [

View File

@ -52,7 +52,9 @@ class DisplayWhen {
}
/**
* TODO
*/
@Directive({
selector: '[show-when]',
host: {
@ -60,7 +62,11 @@ class DisplayWhen {
}
})
export class ShowWhen extends DisplayWhen {
/**
* TODO
* @param {string} showWhen The value of the element's 'show-when' attribute
* @param {NgZone} ngZone TODO
*/
constructor(
@Attribute('show-when') showWhen: string,
ngZone: NgZone
@ -74,7 +80,9 @@ export class ShowWhen extends DisplayWhen {
}
/**
* TODO
*/
@Directive({
selector: '[hide-when]',
host: {
@ -82,7 +90,11 @@ export class ShowWhen extends DisplayWhen {
}
})
export class HideWhen extends DisplayWhen {
/**
* TODO
* @param {string} showWhen The value of the element's 'hide-when' attribute
* @param {NgZone} ngZone TODO
*/
constructor(
@Attribute('hide-when') hideWhen: string,
ngZone: NgZone
@ -95,4 +107,3 @@ export class HideWhen extends DisplayWhen {
}
}