material docs

This commit is contained in:
Tim Lancina
2015-08-28 16:07:54 -07:00
parent 68c27c36a9
commit e0338f7c1c
2 changed files with 46 additions and 1 deletions

View File

@@ -3,11 +3,19 @@ import {ElementRef, Directive, onDestroy} from 'angular2/angular2';
import {IonicConfig} from '../../config/config';
import {MaterialRippleEffect} from '../material/ripple';
/**
* TODO
*/
@Directive({
selector: 'button,[button]',
lifecycle: [onDestroy]
})
export class MaterialButton {
/**
* TODO
* @param {ElementRef} elementRef TODO
* @param {IonicConfig} config TODO
*/
constructor(elementRef: ElementRef, config: IonicConfig) {
this.elementRef = elementRef;

View File

@@ -8,7 +8,14 @@ import {ElementRef, forwardRef} from 'angular2/angular2';
import {MaterialButton} from './button';
/**
* TODO
*/
export class MaterialRippleEffect {
/**
* TODO
* @param {MaterialButton} button TODO
*/
constructor(button: MaterialButton) {
this.elementRef = button.elementRef;
this.element = this.elementRef.nativeElement;
@@ -37,6 +44,10 @@ export class MaterialRippleEffect {
this._initRipple();
}
/**
* @private
* TODO
*/
_initRipple() {
this.frameCount = 0;
this.rippleSize = 0;
@@ -124,24 +135,44 @@ export class MaterialRippleEffect {
}
}
/**
* TODO
* @returns {TODO} TODO
*/
getFrameCount() {
return this.frameCount;
}
/**
* TODO
* @param {TODO} fC TODO
*/
setFrameCount(fC) {
this.frameCount = fC;
}
/**
* TODO
* @return {Element} TODO
*/
getRippleElement() {
return this.rippleElement;
}
/**
* TODO
* @param {number} newX TODO
* @param {number} newY TODO
*/
setRippleXY(newX, newY) {
this.x = newX;
this.y = newY;
}
/**
* TODO
* @param {TODO} start TODO
*/
setRippleStyles(start) {
if (this.rippleElement !== null) {
var transformString;
@@ -174,6 +205,9 @@ export class MaterialRippleEffect {
}
}
/**
* TODO
*/
animFrameHandler() {
if (this.frameCount-- > 0) {
window.requestAnimationFrame(this.animFrameHandler.bind(this));
@@ -182,5 +216,8 @@ export class MaterialRippleEffect {
}
}
/**
* TODO
*/
elementClicked(event) {}
}