chore(): begin adding ionic components to mono-repo.

This commit is contained in:
Josh Thomas
2017-06-21 09:33:06 -05:00
parent 1181fe98fc
commit bd5b67304d
2159 changed files with 15687 additions and 147 deletions

View File

@ -0,0 +1,39 @@
import { Directive, ElementRef } from '@angular/core';
import { DomController } from '../../platform/dom-controller';
import { Tab } from './tab';
/**
* @hidden
*/
@Directive({
selector: '.tab-highlight'
})
export class TabHighlight {
private _init: boolean;
constructor(private _elementRef: ElementRef, private _dom: DomController) {}
select(tab: Tab) {
const dom = this._dom;
dom.read(() => {
const btnEle: HTMLElement = tab.btn.getElementRef().nativeElement;
const transform = `translate3d(${btnEle.offsetLeft}px,0,0) scaleX(${btnEle.offsetWidth})`;
dom.write(() => {
const ele = this._elementRef.nativeElement;
(<any>ele.style)[dom.plt.Css.transform] = transform;
if (!this._init) {
this._init = true;
dom.write(() => {
ele.classList.add('animate');
}, 80);
}
});
}, 32);
}
}