style(tslint): tslint updates

This commit is contained in:
Adam Bradley
2016-04-06 21:28:52 -05:00
parent d8e670ca7c
commit 6f3b9bef82
41 changed files with 133 additions and 137 deletions

View File

@ -885,8 +885,7 @@ gulp.task("tslint", function() {
var tslint = require("gulp-tslint"); var tslint = require("gulp-tslint");
gulp.src([ gulp.src([
'ionic/**/*.ts', 'ionic/**/*.ts',
'!ionic/components/*/test/**/*', '!ionic/**/test/**/*',
'!ionic/util/test/*'
]).pipe(tslint()) ]).pipe(tslint())
.pipe(tslint.report('verbose')); .pipe(tslint.report('verbose'));
}); });

View File

@ -12,7 +12,7 @@ import {rafFrames} from '../../util/dom';
*/ */
@Injectable() @Injectable()
export class IonicApp { export class IonicApp {
private _cmps: {[id: string] : any} = {}; private _cmps: {[id: string]: any} = {};
private _disTime: number = 0; private _disTime: number = 0;
private _scrollTime: number = 0; private _scrollTime: number = 0;
private _title: string = ''; private _title: string = '';
@ -65,7 +65,7 @@ export class IonicApp {
* it will automatically enable the app again. It's basically a fallback incase * it will automatically enable the app again. It's basically a fallback incase
* something goes wrong during a transition and the app wasn't re-enabled correctly. * something goes wrong during a transition and the app wasn't re-enabled correctly.
*/ */
setEnabled(isEnabled: boolean, duration: number=700) { setEnabled(isEnabled: boolean, duration: number = 700) {
this._disTime = (isEnabled ? 0 : Date.now() + duration); this._disTime = (isEnabled ? 0 : Date.now() + duration);
if (duration > 32 || isEnabled) { if (duration > 32 || isEnabled) {

View File

@ -38,7 +38,7 @@ export class Badge {
attrName = elementAttrs[i].name; attrName = elementAttrs[i].name;
// Ignore attributes item-left, item-right // Ignore attributes item-left, item-right
if (attrName.indexOf('item') == -1) { if (attrName.indexOf('item') === -1) {
this._setClass(attrName); this._setClass(attrName);
} }
} }

View File

@ -168,7 +168,7 @@ export class Content extends Ion {
return () => { return () => {
if (!this.scrollElement) { return; } if (!this.scrollElement) { return; }
this.scrollElement.removeEventListener(type, handler); this.scrollElement.removeEventListener(type, handler);
} };
} }
/** /**

View File

@ -150,7 +150,7 @@ export class Icon {
css += this._name; css += this._name;
} }
if (this.mode == 'ios' && !this.isActive) { if (this.mode === 'ios' && !this.isActive) {
css += '-outline'; css += '-outline';
} }

View File

@ -1,4 +1,4 @@
import {Component, Input} from 'angular2/core' import {Component, Input} from 'angular2/core';
import {NgIf} from 'angular2/common'; import {NgIf} from 'angular2/common';
import {Config} from '../../config/config'; import {Config} from '../../config/config';

View File

@ -172,7 +172,7 @@ export class InfiniteScroll {
if (this._thrPc) { if (this._thrPc) {
reloadY += (reloadY * this._thrPc); reloadY += (reloadY * this._thrPc);
} else { } else {
reloadY += this._thrPx reloadY += this._thrPx;
} }
let distanceFromInfinite = ((d.scrollHeight - infiniteHeight) - d.scrollTop) - reloadY; let distanceFromInfinite = ((d.scrollHeight - infiniteHeight) - d.scrollTop) - reloadY;

View File

@ -398,7 +398,7 @@ export class InputBase {
* @private * @private
*/ */
clearTextInput() { clearTextInput() {
console.debug("Should clear input"); console.debug('Should clear input');
} }
/** /**
@ -578,7 +578,6 @@ export class InputBase {
const SCROLL_ASSIST_SPEED = 0.3; const SCROLL_ASSIST_SPEED = 0.3;
function getScrollAssistDuration(distanceToScroll) { function getScrollAssistDuration(distanceToScroll) {
//return 3000;
distanceToScroll = Math.abs(distanceToScroll); distanceToScroll = Math.abs(distanceToScroll);
let duration = distanceToScroll / SCROLL_ASSIST_SPEED; let duration = distanceToScroll / SCROLL_ASSIST_SPEED;
return Math.min(400, Math.max(150, duration)); return Math.min(400, Math.max(150, duration));

View File

@ -13,7 +13,7 @@ export class ItemSlidingGesture extends DragGesture {
onMouseOut; onMouseOut;
preventDrag: boolean = false; preventDrag: boolean = false;
dragEnded: boolean = true; dragEnded: boolean = true;
constructor(public list: List, public listEle: HTMLElement) { constructor(public list: List, public listEle: HTMLElement) {
super(listEle, { super(listEle, {
direction: 'x', direction: 'x',
@ -196,7 +196,7 @@ export class ItemSlidingGesture extends DragGesture {
if (openAmount) { if (openAmount) {
isItemActive(itemContainerEle, true); isItemActive(itemContainerEle, true);
this.on('tap', this.onTap); this.on('tap', this.onTap);
} else { } else {
this.off('tap', this.onTap); this.off('tap', this.onTap);
} }

View File

@ -47,7 +47,7 @@ import {Label} from '../label/label';
'<div class="input-wrapper">' + '<div class="input-wrapper">' +
'<ng-content select="ion-label"></ng-content>' + '<ng-content select="ion-label"></ng-content>' +
'<ion-label *ngIf="_viewLabel">' + '<ion-label *ngIf="_viewLabel">' +
'<ng-content></ng-content>'+ '<ng-content></ng-content>' +
'</ion-label>' + '</ion-label>' +
'<ng-content select="ion-select,ion-input,ion-textarea"></ng-content>' + '<ng-content select="ion-select,ion-input,ion-textarea"></ng-content>' +
'</div>' + '</div>' +

View File

@ -115,7 +115,7 @@ export class List extends Ion {
export class ListHeader { export class ListHeader {
private _id: string; private _id: string;
constructor(private _renderer: Renderer, private _elementRef: ElementRef, @Attribute('id') id:string) { constructor(private _renderer: Renderer, private _elementRef: ElementRef, @Attribute('id') id: string) {
this._id = id; this._id = id;
} }

View File

@ -326,4 +326,4 @@ export class MenuController {
} }
let menuTypes:{ [name: string]: new(...args: any[]) => MenuType } = {}; let menuTypes: { [name: string]: new(...args: any[]) => MenuType } = {};

View File

@ -30,7 +30,7 @@ import {MenuController} from './menu-controller';
selector: '[menuToggle]', selector: '[menuToggle]',
host: { host: {
'[hidden]': 'isHidden', '[hidden]': 'isHidden',
'menuToggle': '' //ensures the attr is there for css when using [menuToggle] 'menuToggle': '' // ensures the attr is there for css when using [menuToggle]
} }
}) })
export class MenuToggle { export class MenuToggle {
@ -77,7 +77,7 @@ export class MenuToggle {
if (menu) { if (menu) {
// this is not the root view, so see if this menu // this is not the root view, so see if this menu
// is configured to still be enabled if it's not the root view // is configured to still be enabled if it's not the root view
return !menu.persistent; return !menu.persistent;
} }
} }
return false; return false;

View File

@ -65,7 +65,7 @@ class MenuRevealType extends MenuType {
constructor(menu) { constructor(menu) {
super(); super();
let openedX = (menu.width() * (menu.side == 'right' ? -1 : 1)) + 'px'; let openedX = (menu.width() * (menu.side === 'right' ? -1 : 1)) + 'px';
this.ani this.ani
.easing('ease') .easing('ease')
@ -95,10 +95,11 @@ class MenuPushType extends MenuType {
let contentOpenedX, menuClosedX, menuOpenedX; let contentOpenedX, menuClosedX, menuOpenedX;
if (menu.side == 'right') { if (menu.side === 'right') {
contentOpenedX = -menu.width() + 'px'; contentOpenedX = -menu.width() + 'px';
menuOpenedX = (menu._platform.width() - menu.width()) + 'px'; menuOpenedX = (menu._platform.width() - menu.width()) + 'px';
menuClosedX = menu._platform.width() + 'px'; menuClosedX = menu._platform.width() + 'px';
} else { } else {
contentOpenedX = menu.width() + 'px'; contentOpenedX = menu.width() + 'px';
menuOpenedX = '0px'; menuOpenedX = '0px';
@ -132,7 +133,7 @@ class MenuOverlayType extends MenuType {
.duration(250); .duration(250);
let closedX, openedX; let closedX, openedX;
if (menu.side == 'right') { if (menu.side === 'right') {
// right side // right side
closedX = menu._platform.width() + 'px'; closedX = menu._platform.width() + 'px';
openedX = (menu._platform.width() - menu.width() - 8) + 'px'; openedX = (menu._platform.width() - menu.width() - 8) + 'px';

View File

@ -163,7 +163,7 @@ export class Menu extends Ion {
// register listeners if this menu is enabled // register listeners if this menu is enabled
// check if more than one menu is on the same side // check if more than one menu is on the same side
let hasEnabledSameSideMenu = self._menuCtrl.getMenus().some(m => { let hasEnabledSameSideMenu = self._menuCtrl.getMenus().some(m => {
return m.side === self.side && m.enabled; return m.side === self.side && m.enabled;
}); });
if (hasEnabledSameSideMenu) { if (hasEnabledSameSideMenu) {

View File

@ -103,7 +103,7 @@ import {Transition, TransitionOptions} from '../../transitions/transition';
*/ */
export class Modal extends ViewController { export class Modal extends ViewController {
constructor(componentType, data={}) { constructor(componentType, data = {}) {
super(componentType, data); super(componentType, data);
this.viewType = 'modal'; this.viewType = 'modal';
this.isOverlay = true; this.isOverlay = true;
@ -121,7 +121,7 @@ export class Modal extends ViewController {
* @param {any} componentType Modal * @param {any} componentType Modal
* @param {object} data Modal options * @param {object} data Modal options
*/ */
static create(componentType, data={}) { static create(componentType, data = {}) {
return new Modal(componentType, data); return new Modal(componentType, data);
} }

View File

@ -708,7 +708,7 @@ export class NavController extends Ion {
startIndex = this._views.length - 1; startIndex = this._views.length - 1;
} else if (startIndex < 0 || startIndex >= this._views.length) { } else if (startIndex < 0 || startIndex >= this._views.length) {
return Promise.reject("remove index out of range"); return Promise.reject('remove index out of range');
} }
if (isBlank(opts)) { if (isBlank(opts)) {

View File

@ -25,7 +25,7 @@
* @see {@link ../NavPush/ NavPush API Docs} * @see {@link ../NavPush/ NavPush API Docs}
*/ */
export class NavParams { export class NavParams {
/** /**
* @private * @private
* @param {TODO} data TODO * @param {TODO} data TODO

View File

@ -78,7 +78,7 @@ export class NavPush {
if (this.navPush instanceof Array) { if (this.navPush instanceof Array) {
if (this.navPush.length > 2) { if (this.navPush.length > 2) {
throw 'Too many [navPush] arguments, expects [View, { params }]' throw 'Too many [navPush] arguments, expects [View, { params }]';
} }
destination = this.navPush[0]; destination = this.navPush[0];
params = this.navPush[1] || this.navParams; params = this.navPush[1] || this.navParams;
@ -88,7 +88,7 @@ export class NavPush {
params = this.navParams; params = this.navParams;
} }
if (typeof destination === "string") { if (typeof destination === 'string') {
destination = this.registry.get(destination); destination = this.registry.get(destination);
} }

View File

@ -174,8 +174,8 @@ export class Nav extends NavController {
this.push(this._root); this.push(this._root);
} }
} }
@ViewChild(Portal) @ViewChild(Portal)
private set _navPortal(val: Portal) { private set _navPortal(val: Portal) {
this.setPortal(val); this.setPortal(val);
} }

View File

@ -94,7 +94,7 @@ export class ViewController {
constructor(public componentType?: Type, data?: any) { constructor(public componentType?: Type, data?: any) {
// passed in data could be NavParams, but all we care about is its data object // passed in data could be NavParams, but all we care about is its data object
this.data = (data instanceof NavParams ? data.data : isPresent(data) ? data : {}); this.data = (data instanceof NavParams ? data.data : (isPresent(data) ? data : {}));
} }
subscribe(generatorOrNext?: any): any { subscribe(generatorOrNext?: any): any {
@ -531,7 +531,7 @@ function ctrlFn(viewCtrl: ViewController, fnName: string) {
if (viewCtrl.instance && viewCtrl.instance[fnName]) { if (viewCtrl.instance && viewCtrl.instance[fnName]) {
try { try {
viewCtrl.instance[fnName](); viewCtrl.instance[fnName]();
} catch(e) { } catch (e) {
console.error(viewCtrl.name + ' ' + fnName + ': ' + e.message); console.error(viewCtrl.name + ' ' + fnName + ': ' + e.message);
} }
} }

View File

@ -202,7 +202,7 @@ export class Navbar extends ToolbarBase {
didEnter() { didEnter() {
try { try {
this._app.setTitle(this.getTitleText()); this._app.setTitle(this.getTitleText());
} catch(e) { } catch (e) {
console.error(e); console.error(e);
} }
} }

View File

@ -186,7 +186,7 @@ export class RadioGroup {
remove(button: RadioButton) { remove(button: RadioButton) {
let index = this._btns.indexOf(button); let index = this._btns.indexOf(button);
if (index > -1) { if (index > -1) {
if (button.value == this.value) { if (button.value === this.value) {
this.value = null; this.value = null;
} }
this._btns.splice(index, 1); this._btns.splice(index, 1);

View File

@ -1,4 +1,4 @@
import {Component, Input} from 'angular2/core' import {Component, Input} from 'angular2/core';
import {NgIf} from 'angular2/common'; import {NgIf} from 'angular2/common';
import {Config} from '../../config/config'; import {Config} from '../../config/config';

View File

@ -1,4 +1,4 @@
import {Directive, ElementRef, EventEmitter, Host, Input, Output, NgZone} from 'angular2/core' import {Directive, ElementRef, EventEmitter, Host, Input, Output, NgZone} from 'angular2/core';
import {NgIf, NgClass} from 'angular2/common'; import {NgIf, NgClass} from 'angular2/common';
import {Content} from '../content/content'; import {Content} from '../content/content';
@ -411,7 +411,7 @@ export class Refresher {
this.state = STATE_REFRESHING; this.state = STATE_REFRESHING;
// place the content in a hangout position while it thinks // place the content in a hangout position while it thinks
this._setCss(this.pullMin,( this.snapbackDuration + 'ms'), true, ''); this._setCss(this.pullMin, (this.snapbackDuration + 'ms'), true, '');
// emit "refresh" because it was pulled down far enough // emit "refresh" because it was pulled down far enough
// and they let go to begin refreshing // and they let go to begin refreshing

View File

@ -77,13 +77,13 @@ export class Scroll extends Ion {
* undefined if the scroll element doesn't exist. * undefined if the scroll element doesn't exist.
*/ */
addScrollEventListener(handler) { addScrollEventListener(handler) {
if(!this.scrollElement) { return; } if (!this.scrollElement) { return; }
this.scrollElement.addEventListener('scroll', handler); this.scrollElement.addEventListener('scroll', handler);
return () => { return () => {
this.scrollElement.removeEventListener('scroll', handler); this.scrollElement.removeEventListener('scroll', handler);
} };
} }
} }

View File

@ -67,7 +67,7 @@ export class SearchbarInput {
directives: [FORM_DIRECTIVES, NgIf, NgClass, Icon, Button, SearchbarInput] directives: [FORM_DIRECTIVES, NgIf, NgClass, Icon, Button, SearchbarInput]
}) })
export class Searchbar extends Ion { export class Searchbar extends Ion {
private _tmr: number; private _tmr: any;
/** /**
* @private * @private
@ -191,7 +191,7 @@ export class Searchbar extends Ion {
if (this.ngModel) this.value = this.ngModel; if (this.ngModel) this.value = this.ngModel;
this.onChange(this.value); this.onChange(this.value);
this.shouldLeftAlign = this.value && this.value.trim() != ''; this.shouldLeftAlign = this.value && this.value.trim() !== '';
// Using querySelector instead of searchbarInput because at this point it doesn't exist // Using querySelector instead of searchbarInput because at this point it doesn't exist
this.inputElement = this._elementRef.nativeElement.querySelector('.searchbar-input'); this.inputElement = this._elementRef.nativeElement.querySelector('.searchbar-input');
@ -222,8 +222,8 @@ export class Searchbar extends Ion {
if (this.mode !== 'ios') return; if (this.mode !== 'ios') return;
if (this.shouldLeftAlign) { if (this.shouldLeftAlign) {
this.inputElement.removeAttribute("style"); this.inputElement.removeAttribute('style');
this.searchIconElement.removeAttribute("style"); this.searchIconElement.removeAttribute('style');
} else { } else {
this.addElementLeft(); this.addElementLeft();
} }
@ -245,11 +245,11 @@ export class Searchbar extends Ion {
tempSpan.remove(); tempSpan.remove();
// Set the input padding left // Set the input padding left
let inputLeft = "calc(50% - " + (textWidth / 2) + "px)"; let inputLeft = 'calc(50% - ' + (textWidth / 2) + 'px)';
this.inputElement.style.paddingLeft = inputLeft; this.inputElement.style.paddingLeft = inputLeft;
// Set the icon margin left // Set the icon margin left
let iconLeft = "calc(50% - " + ((textWidth / 2) + 30) + "px)"; let iconLeft = 'calc(50% - ' + ((textWidth / 2) + 30) + 'px)';
this.searchIconElement.style.marginLeft = iconLeft; this.searchIconElement.style.marginLeft = iconLeft;
} }
@ -288,7 +288,7 @@ export class Searchbar extends Ion {
inputBlurred() { inputBlurred() {
// blurInput determines if it should blur // blurInput determines if it should blur
// if we are clearing the input we still want to stay focused in the input // if we are clearing the input we still want to stay focused in the input
if (this.blurInput == false) { if (this.blurInput === false) {
this.searchbarInput._elementRef.nativeElement.focus(); this.searchbarInput._elementRef.nativeElement.focus();
this.blurInput = true; this.blurInput = true;
return; return;
@ -296,7 +296,7 @@ export class Searchbar extends Ion {
this.blur.emit(this); this.blur.emit(this);
this.isFocused = false; this.isFocused = false;
this.shouldLeftAlign = this.value && this.value.trim() != ''; this.shouldLeftAlign = this.value && this.value.trim() !== '';
this.setElementLeft(); this.setElementLeft();
} }
@ -338,7 +338,7 @@ export class Searchbar extends Ion {
/** /**
* @private * @private
*/ */
onChange = (_:any) => {}; onChange = (_: any) => {};
/** /**
* @private * @private
@ -349,7 +349,7 @@ export class Searchbar extends Ion {
* @private * @private
* Set the function to be called when the control receives a change event. * Set the function to be called when the control receives a change event.
*/ */
registerOnChange(fn:(_:any) => {}):void { registerOnChange(fn: (_: any) => {}): void {
this.onChange = fn; this.onChange = fn;
} }
@ -357,7 +357,7 @@ export class Searchbar extends Ion {
* @private * @private
* Set the function to be called when the control receives a touch event. * Set the function to be called when the control receives a touch event.
*/ */
registerOnTouched(fn:() => {}):void { registerOnTouched(fn: () => {}): void {
this.onTouched = fn; this.onTouched = fn;
} }
} }

View File

@ -233,7 +233,7 @@ export class Select {
label: input.text, label: input.text,
value: input.value, value: input.value,
checked: input.checked checked: input.checked
} };
}); });
// create the alert instance from our built up alertOptions // create the alert instance from our built up alertOptions

View File

@ -1,4 +1,4 @@
import {Directive, Attribute, NgZone} from 'angular2/core' import {Directive, Attribute, NgZone} from 'angular2/core';
import {Platform} from '../../platform/platform'; import {Platform} from '../../platform/platform';
@ -42,12 +42,12 @@ export class DisplayWhen {
orientation(): boolean { orientation(): boolean {
for (let i = 0; i < this.conditions.length; i++) { for (let i = 0; i < this.conditions.length; i++) {
if (this.conditions[i] == 'portrait') { if (this.conditions[i] === 'portrait') {
this.isMatch = this.platform.isPortrait(); this.isMatch = this.platform.isPortrait();
return true; return true;
} }
if (this.conditions[i] == 'landscape') { if (this.conditions[i] === 'landscape') {
this.isMatch = this.platform.isLandscape(); this.isMatch = this.platform.isLandscape();
return true; return true;
} }

View File

@ -7,7 +7,7 @@ import {Gesture} from '../../gestures/gesture';
import {DragGesture} from '../../gestures/drag-gesture'; import {DragGesture} from '../../gestures/drag-gesture';
import {dom} from '../../util'; import {dom} from '../../util';
import {CSS} from '../../util/dom'; import {CSS} from '../../util/dom';
import {debounce, isTrueProperty, defaults} from '../../util/util' import {debounce, isTrueProperty, defaults} from '../../util/util';
import {Swiper} from './swiper-widget'; import {Swiper} from './swiper-widget';
import {Scroll} from '../scroll/scroll'; import {Scroll} from '../scroll/scroll';
@ -151,7 +151,7 @@ export class Slides extends Ion {
zoomable: HTMLElement, zoomable: HTMLElement,
zoomableWidth: number, zoomableWidth: number,
zoomableHeight: number zoomableHeight: number
} };
/** /**
* @input {boolean} Whether the slide should show the pager or not * @input {boolean} Whether the slide should show the pager or not
@ -356,13 +356,13 @@ export class Slides extends Ion {
this.zoomGesture.on('pinch', (e) => { this.zoomGesture.on('pinch', (e) => {
this.scale = Math.max(1, Math.min(last_scale * e.scale, 10)); this.scale = Math.max(1, Math.min(last_scale * e.scale, 10));
console.debug('Scaling', this.scale); console.debug('Scaling', this.scale);
this.zoomElement.style[CSS.transform] = 'scale(' + this.scale + ')' this.zoomElement.style[CSS.transform] = 'scale(' + this.scale + ')';
zoomRect = this.zoomElement.getBoundingClientRect(); zoomRect = this.zoomElement.getBoundingClientRect();
}); });
this.zoomGesture.on('pinchend', (e) => { this.zoomGesture.on('pinchend', () => {
//last_scale = Math.max(1, Math.min(last_scale * e.scale, 10)); // last_scale = Math.max(1, Math.min(last_scale * e.scale, 10));
if (this.scale > this.maxScale) { if (this.scale > this.maxScale) {
let za = new Animation(this.zoomElement) let za = new Animation(this.zoomElement)
.duration(this.zoomDuration) .duration(this.zoomDuration)
@ -438,31 +438,31 @@ export class Slides extends Ion {
za.add(zi); za.add(zi);
if (this.scale > 1) { if (this.scale > 1) {
// Zoom out // zoom out
//zw.fromTo('translateX', posX + 'px', '0px'); // zw.fromTo('translateX', posX + 'px', '0px');
//zw.fromTo('translateY', posY + 'px', '0px'); // zw.fromTo('translateY', posY + 'px', '0px');
zi.from('scale', this.scale); zi.from('scale', this.scale);
zi.to('scale', 1); zi.to('scale', 1);
za.play(); za.play();
//posX = 0; // posX = 0;
//posY = 0; // posY = 0;
this.scale = 1; this.scale = 1;
} else { } else {
// Zoom in // zoom in
//zw.fromTo('translateX', posX + 'px', tx + 'px'); // zw.fromTo('translateX', posX + 'px', tx + 'px');
//zw.fromTo('translateY', posY + 'px', ty + 'px'); // zw.fromTo('translateY', posY + 'px', ty + 'px');
zi.from('scale', this.scale); zi.from('scale', this.scale);
zi.to('scale', this.maxScale); zi.to('scale', this.maxScale);
za.play(); za.play();
//posX = tx; // posX = tx;
//posY = ty; // posY = ty;
this.scale = this.maxScale; this.scale = this.maxScale;
} }
@ -485,7 +485,7 @@ export class Slides extends Ion {
onTouchStart(e) { onTouchStart(e) {
console.debug('Touch start', e); console.debug('Touch start', e);
//TODO: Support mice as well // TODO: Support mice as well
let target = ((dom.closest(e.target, '.slide').children[0] as HTMLElement).children[0] as HTMLElement); let target = ((dom.closest(e.target, '.slide').children[0] as HTMLElement).children[0] as HTMLElement);
@ -502,11 +502,10 @@ export class Slides extends Ion {
zoomable: target, zoomable: target,
zoomableWidth: target.offsetWidth, zoomableWidth: target.offsetWidth,
zoomableHeight: target.offsetHeight zoomableHeight: target.offsetHeight
} };
console.debug('Target', this.touch.target); console.debug('Target', this.touch.target);
//TODO: android prevent default // TODO: android prevent default
} }
/** /**
@ -521,9 +520,9 @@ export class Slides extends Ion {
let zoomableScaledWidth = this.touch.zoomableWidth * this.scale; let zoomableScaledWidth = this.touch.zoomableWidth * this.scale;
let zoomableScaledHeight = this.touch.zoomableHeight * this.scale; let zoomableScaledHeight = this.touch.zoomableHeight * this.scale;
let x1 = Math.min((this.viewportWidth / 2) - zoomableScaledWidth/2, 0) let x1 = Math.min((this.viewportWidth / 2) - zoomableScaledWidth / 2, 0);
let x2 = -x1; let x2 = -x1;
let y1 = Math.min((this.viewportHeight / 2) - zoomableScaledHeight/2, 0) let y1 = Math.min((this.viewportHeight / 2) - zoomableScaledHeight / 2, 0);
let y2 = -y1; let y2 = -y1;
console.debug('BOUNDS', x1, x2, y1, y2); console.debug('BOUNDS', x1, x2, y1, y2);
@ -534,24 +533,24 @@ export class Slides extends Ion {
console.debug('PAN', e); console.debug('PAN', e);
// Move image // move image
this.touch.x = this.touch.deltaX + this.touch.lastX; this.touch.x = this.touch.deltaX + this.touch.lastX;
this.touch.y = this.touch.deltaY + this.touch.lastY; this.touch.y = this.touch.deltaY + this.touch.lastY;
if (this.touch.x < x1) { if (this.touch.x < x1) {
console.debug('OUT ON LEFT'); console.debug('OUT ON LEFT');
} }
if (this.touch.x > x2 ){ if (this.touch.x > x2 ) {
console.debug('OUT ON RIGHT'); console.debug('OUT ON RIGHT');
} }
if (this.touch.x > this.viewportWidth) { if (this.touch.x > this.viewportWidth) {
// Too far on the left side, let the event bubble up (to enable slider on edges, for example) // too far on the left side, let the event bubble up (to enable slider on edges, for example)
} else if (-this.touch.x > this.viewportWidth) { } else if (-this.touch.x > this.viewportWidth) {
// Too far on the right side, let the event bubble up (to enable slider on edges, for example) // too far on the right side, let the event bubble up (to enable slider on edges, for example)
} else { } else {
console.debug('TRANSFORM', this.touch.x, this.touch.y, this.touch.target); console.debug('TRANSFORM', this.touch.x, this.touch.y, this.touch.target);
//this.touch.target.style[CSS.transform] = 'translateX(' + this.touch.x + 'px) translateY(' + this.touch.y + 'px)'; // this.touch.target.style[CSS.transform] = 'translateX(' + this.touch.x + 'px) translateY(' + this.touch.y + 'px)';
this.touch.target.style[CSS.transform] = 'translateX(' + this.touch.x + 'px) translateY(' + this.touch.y + 'px)'; this.touch.target.style[CSS.transform] = 'translateX(' + this.touch.x + 'px) translateY(' + this.touch.y + 'px)';
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();

View File

@ -1,12 +1,11 @@
export declare class Swiper { export declare class Swiper {
constructor(container: HTMLElement, params: any); constructor(container: HTMLElement, params: any);
slides: Array<HTMLElement>; slides: Array<HTMLElement>;
activeIndex: number; activeIndex: number;
isEnd: boolean; isEnd: boolean;
isBeginning: boolean; isBeginning: boolean;
update(): any;
update():any; slideNext(): any;
slideNext():any; slidePrev(): any;
slidePrev():any;
} }

View File

@ -185,7 +185,7 @@ export class Spinner {
} }
_loadEle(spinner: any, index: number, total: number) { _loadEle(spinner: any, index: number, total: number) {
let duration = this._dur || spinner.dur let duration = this._dur || spinner.dur;
let data = spinner.fn(duration, index, total); let data = spinner.fn(duration, index, total);
data.style.animationDuration = duration + 'ms'; data.style.animationDuration = duration + 'ms';
return data; return data;
@ -206,7 +206,7 @@ const SPINNERS = {
transform: 'rotate(' + (30 * index + (index < 6 ? 180 : -180)) + 'deg)', transform: 'rotate(' + (30 * index + (index < 6 ? 180 : -180)) + 'deg)',
animationDelay: -(dur - ((dur / total) * index)) + 'ms' animationDelay: -(dur - ((dur / total) * index)) + 'ms'
} }
} };
} }
}, },
@ -221,7 +221,7 @@ const SPINNERS = {
transform: 'rotate(' + (30 * index + (index < 6 ? 180 : -180)) + 'deg)', transform: 'rotate(' + (30 * index + (index < 6 ? 180 : -180)) + 'deg)',
animationDelay: -(dur - ((dur / total) * index)) + 'ms' animationDelay: -(dur - ((dur / total) * index)) + 'ms'
} }
} };
} }
}, },
@ -236,7 +236,7 @@ const SPINNERS = {
left: 9 * Math.cos(2 * Math.PI * index / total), left: 9 * Math.cos(2 * Math.PI * index / total),
animationDelay: -(dur - ((dur / total) * index)) + 'ms' animationDelay: -(dur - ((dur / total) * index)) + 'ms'
} }
} };
} }
}, },
@ -251,7 +251,7 @@ const SPINNERS = {
left: 9 * Math.cos(2 * Math.PI * index / total), left: 9 * Math.cos(2 * Math.PI * index / total),
animationDelay: -(dur - ((dur / total) * index)) + 'ms' animationDelay: -(dur - ((dur / total) * index)) + 'ms'
} }
} };
} }
}, },
@ -262,7 +262,7 @@ const SPINNERS = {
return { return {
r: 26, r: 26,
style: {} style: {}
} };
} }
}, },
@ -276,7 +276,7 @@ const SPINNERS = {
left: (9 - (9 * index)), left: (9 - (9 * index)),
animationDelay: -(110 * index) + 'ms' animationDelay: -(110 * index) + 'ms'
} }
} };
} }
} }

View File

@ -45,7 +45,7 @@ export class TabButton extends Ion {
this._layout = this.tab.parent.tabbarLayout || this._layout; this._layout = this.tab.parent.tabbarLayout || this._layout;
this.hasTitle = !!this.tab.tabTitle; this.hasTitle = !!this.tab.tabTitle;
this.hasIcon = !!this.tab.tabIcon && this._layout != 'icon-hide'; this.hasIcon = !!this.tab.tabIcon && this._layout !== 'icon-hide';
this.hasTitleOnly = (this.hasTitle && !this.hasIcon); this.hasTitleOnly = (this.hasTitle && !this.hasIcon);
this.hasIconOnly = (this.hasIcon && !this.hasTitle); this.hasIconOnly = (this.hasIcon && !this.hasTitle);
this.hasBadge = !!this.tab.tabBadge; this.hasBadge = !!this.tab.tabBadge;

View File

@ -10,7 +10,7 @@ import {rafFrames} from '../../util/dom';
}) })
export class TabHighlight { export class TabHighlight {
private _init: boolean; private _init: boolean;
constructor(private _elementRef: ElementRef) {} constructor(private _elementRef: ElementRef) {}
select(tab) { select(tab) {

View File

@ -132,7 +132,7 @@ export class Tabs extends Ion {
/** /**
* @private * @private
*/ */
parent: any parent: any;
constructor( constructor(
@Optional() viewCtrl: ViewController, @Optional() viewCtrl: ViewController,
@ -171,7 +171,7 @@ export class Tabs extends Ion {
this._setConfig('tabbarIcons', 'top'); this._setConfig('tabbarIcons', 'top');
if (this.tabbarIcons) { if (this.tabbarIcons) {
console.warn("DEPRECATION WARNING: 'tabbarIcons' is no longer supported and will be removed in next major release. Use 'tabbarLayout' instead. Available values: 'icon-top', 'icon-left', 'icon-right', 'icon-bottom', 'icon-hide', 'title-hide'."); console.warn('DEPRECATION WARNING: "tabbarIcons" is no longer supported and will be removed in next major release. Use "tabbarLayout" instead. Available values: "icon-top", "icon-left", "icon-right", "icon-bottom", "icon-hide", "title-hide".');
} }
if (this._useHighlight) { if (this._useHighlight) {
@ -342,7 +342,7 @@ export class Tabs extends Ion {
// Otherwise, if the page we're on is not our real root, reset it to our // Otherwise, if the page we're on is not our real root, reset it to our
// default root type // default root type
if (tab.root != active.componentType) { if (tab.root !== active.componentType) {
return tab.setRoot(tab.root); return tab.setRoot(tab.root);
} }

View File

@ -27,10 +27,10 @@ export class TapClick {
) { ) {
let self = this; let self = this;
if (config.get('activator') == 'ripple') { if (config.get('activator') === 'ripple') {
self.activator = new RippleActivator(app, config, zone); self.activator = new RippleActivator(app, config, zone);
} else if (config.get('activator') == 'highlight') { } else if (config.get('activator') === 'highlight') {
self.activator = new Activator(app, config, zone); self.activator = new Activator(app, config, zone);
} }

View File

@ -227,10 +227,10 @@ export function populateNodeData(startCellIndex: number, endCellIndex: number, v
}; };
totalNodes = nodes.push(availableNode); totalNodes = nodes.push(availableNode);
//console.debug(`VirtrualScroll, new node, tmpl ${cell.tmpl}, height ${cell.height}`); // console.debug(`VirtrualScroll, new node, tmpl ${cell.tmpl}, height ${cell.height}`);
} }
//console.debug(`node was cell ${availableNode.cell} but is now ${cellIndex}, was top: ${cell.top}`); // console.debug(`node was cell ${availableNode.cell} but is now ${cellIndex}, was top: ${cell.top}`);
// assign who's the new cell index for this node // assign who's the new cell index for this node
availableNode.cell = cellIndex; availableNode.cell = cellIndex;
@ -238,8 +238,8 @@ export function populateNodeData(startCellIndex: number, endCellIndex: number, v
// apply the cell's data to this node // apply the cell's data to this node
availableNode.view.setLocal('\$implicit', cell.data || records[cell.record]); availableNode.view.setLocal('\$implicit', cell.data || records[cell.record]);
availableNode.view.setLocal('index', cellIndex); availableNode.view.setLocal('index', cellIndex);
availableNode.view.setLocal('even', (cellIndex % 2 == 0)); availableNode.view.setLocal('even', (cellIndex % 2 === 0));
availableNode.view.setLocal('odd', (cellIndex % 2 == 1)); availableNode.view.setLocal('odd', (cellIndex % 2 === 1));
availableNode.hasChanges = true; availableNode.hasChanges = true;
availableNode.lastTransform = null; availableNode.lastTransform = null;
madeChanges = true; madeChanges = true;
@ -504,7 +504,7 @@ export function adjustRendered(cells: VirtualCell[], data: VirtualData) {
} }
} }
//console.log(`adjustRendered topCell: ${data.topCell}, bottomCell: ${data.bottomCell}, cellsRenderHeight: ${cellsRenderHeight}, data.renderHeight: ${data.renderHeight}`); // console.log(`adjustRendered topCell: ${data.topCell}, bottomCell: ${data.bottomCell}, cellsRenderHeight: ${cellsRenderHeight}, data.renderHeight: ${data.renderHeight}`);
} }

View File

@ -1,31 +1,31 @@
export * from './config/bootstrap' export * from './config/bootstrap';
export * from './config/config' export * from './config/config';
export * from './config/directives' export * from './config/directives';
export * from './decorators/app' export * from './decorators/app';
export * from './decorators/page' export * from './decorators/page';
export * from './components' export * from './components';
export * from './platform/platform' export * from './platform/platform';
export * from './platform/storage' export * from './platform/storage';
export * from './util/click-block' export * from './util/click-block';
export * from './util/events' export * from './util/events';
export * from './util/keyboard' export * from './util/keyboard';
export * from './util/form' export * from './util/form';
export * from './animations/animation' export * from './animations/animation';
export * from './transitions/transition' export * from './transitions/transition';
export * from './translation/translate' export * from './translation/translate';
export * from './translation/translate_pipe' export * from './translation/translate_pipe';
// these modules don't export anything // these modules don't export anything
import './config/modes' import './config/modes';
import './platform/registry' import './platform/registry';
import './animations/builtins' import './animations/builtins';
import './transitions/transition-ios' import './transitions/transition-ios';
import './transitions/transition-md' import './transitions/transition-md';
import './transitions/transition-wp' import './transitions/transition-wp';

View File

@ -109,7 +109,7 @@ export class SqlStorage extends StorageEngine {
} catch (err) { } catch (err) {
reject({ err: err }); reject({ err: err });
} }
}) });
} }
/** /**

View File

@ -4,7 +4,7 @@
* *
* For most cases, we recommend the SqlStorage system as it will store * For most cases, we recommend the SqlStorage system as it will store
* data in a file in the app's sandbox. LocalStorage should ONLY be used * data in a file in the app's sandbox. LocalStorage should ONLY be used
* for temporary data as it may be "cleaned up" by the operation system * for temporary data as it may be 'cleaned up' by the operation system
* during low disk space situations. * during low disk space situations.
*/ */
/** /**
@ -68,18 +68,18 @@ export class StorageEngine {
constructor(options = {}) { } constructor(options = {}) { }
get(key: string): Promise<any> { get(key: string): Promise<any> {
throw Error("get() not implemented for this storage engine"); throw Error('get() not implemented for this storage engine');
} }
set(key: string, value: any): Promise<any> { set(key: string, value: any): Promise<any> {
throw Error("set() not implemented for this storage engine"); throw Error('set() not implemented for this storage engine');
} }
remove(key: string): Promise<any> { remove(key: string): Promise<any> {
throw Error("remove() not implemented for this storage engine"); throw Error('remove() not implemented for this storage engine');
} }
query(query: string, params?: any): Promise<any> { query(query: string, params?: any): Promise<any> {
throw Error("query() not implemented for this storage engine"); throw Error('query() not implemented for this storage engine');
} }
clear(): Promise<any> { clear(): Promise<any> {
throw Error("clear() not implemented for this storage engine"); throw Error('clear() not implemented for this storage engine');
} }
} }

View File

@ -1,4 +1,3 @@
import * as domUtil from './util/dom' import * as domUtil from './util/dom';
export const dom = domUtil export const dom = domUtil;
export * from './util/util';
export * from './util/util'