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 the content and scroll elements' dimensions.
* @returns {Object} dimensions The content and scroll elements' dimensions * @returns {Object} dimensions The content and scroll elements' dimensions
* @returns {Number} dimensions.contentHeight content offsetHeight * {Number} dimensions.contentHeight content offsetHeight
* @returns {Number} dimensions.contentTop content offsetTop * {Number} dimensions.contentTop content offsetTop
* @returns {Number} dimensions.contentBottom content offsetTop+offsetHeight * {Number} dimensions.contentBottom content offsetTop+offsetHeight
* @returns {Number} dimensions.contentWidth content offsetWidth * {Number} dimensions.contentWidth content offsetWidth
* @returns {Number} dimensions.contentLeft content offsetLeft * {Number} dimensions.contentLeft content offsetLeft
* @returns {Number} dimensions.contentRight content offsetLeft + offsetWidth * {Number} dimensions.contentRight content offsetLeft + offsetWidth
* @returns {Number} dimensions.scrollHeight scroll scrollHeight * {Number} dimensions.scrollHeight scroll scrollHeight
* @returns {Number} dimensions.scrollTop scroll scrollTop * {Number} dimensions.scrollTop scroll scrollTop
* @returns {Number} dimensions.scrollBottom scroll scrollTop + scrollHeight * {Number} dimensions.scrollBottom scroll scrollTop + scrollHeight
* @returns {Number} dimensions.scrollWidth scroll scrollWidth * {Number} dimensions.scrollWidth scroll scrollWidth
* @returns {Number} dimensions.scrollLeft scroll scrollLeft * {Number} dimensions.scrollLeft scroll scrollLeft
* @returns {Number} dimensions.scrollRight scroll scrollLeft + scrollWidth * {Number} dimensions.scrollRight scroll scrollLeft + scrollWidth
* TODO: figure out how to get this to work
*/ */
getDimensions() { getDimensions() {
let scrollElement = this.scrollElement; let scrollElement = this.scrollElement;

View File

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

View File

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

View File

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

View File

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