chore(animations): using named functions

- rollup generates a better code
- better for dev debugging
This commit is contained in:
Manuel Mtz-Almeida
2017-09-15 11:45:19 -05:00
parent 93f8dd9433
commit a1fcc61d3b
17 changed files with 33 additions and 34 deletions

View File

@ -11,7 +11,7 @@ export class ActionSheetController {
private actionSheets: ActionSheet[] = [];
@Method()
create(opts?: ActionSheetOptions) {
create(opts?: ActionSheetOptions): Promise<ActionSheet> {
// create ionic's wrapping ion-action-sheet component
const actionSheet = document.createElement('ion-action-sheet');

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/**
* iOS Action Sheet Enter Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/**
* iOS Action Sheet Leave Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -11,7 +11,7 @@ export class AlertController {
private alerts: Alert[] = [];
@Method()
create(opts?: AlertOptions) {
create(opts?: AlertOptions): Promise<Alert> {
// create ionic's wrapping ion-alert component
const alert = document.createElement('ion-alert');

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/**
* iOS Alert Enter Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/**
* iOS Alert Leave Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -485,22 +485,21 @@ export class ItemSliding {
render() {
return (
<ion-gesture props={{
'canStart': this.canStart.bind(this),
'onStart': this.onDragStart.bind(this),
'onMove': this.onDragMove.bind(this),
'onEnd': this.onDragEnd.bind(this),
'gestureName': 'item-swipe',
'gesturePriority': -10,
'type': 'pan',
'direction': 'x',
'maxAngle': 20,
'threshold': 5,
'attachTo': 'parent'
}}>
<slot></slot>
</ion-gesture>
<ion-gesture props={{
'canStart': this.canStart.bind(this),
'onStart': this.onDragStart.bind(this),
'onMove': this.onDragMove.bind(this),
'onEnd': this.onDragEnd.bind(this),
'gestureName': 'item-swipe',
'gesturePriority': -10,
'type': 'pan',
'direction': 'x',
'maxAngle': 20,
'threshold': 5,
'attachTo': 'parent'
}}>
<slot></slot>
</ion-gesture>
);
}
}

View File

@ -11,7 +11,7 @@ export class LoadingController {
private loadings: Loading[] = [];
@Method()
create(opts?: LoadingOptions) {
create(opts?: LoadingOptions): Promise<Loading> {
// create ionic's wrapping ion-loading component
const loading = document.createElement('ion-loading');

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/**
* iOS Loading Enter Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/**
* iOS Loading Leave Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/**
* iOS Modal Enter Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/**
* iOS Modal Leave Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/**
* iOS Popover Enter Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSEnterAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/**
* iOS Popover Leave Animation
*/
export default function(Animation: Animation, baseElm: HTMLElement) {
export default function iOSLeaveAnimation(Animation: Animation, baseElm: HTMLElement): Animation {
const baseAnimation = new Animation();
const backdropAnimation = new Animation();

View File

@ -398,4 +398,4 @@ export class Select {
</button>
];
}
}
}

View File

@ -3,11 +3,11 @@ import { Animation } from '../../../index';
/**
* iOS Toast Enter Animation
*/
export default function(
export default function iOSEnterAnimation(
Animation: Animation,
baseElm: HTMLElement,
position: string
) {
): Animation {
const baseAnimation = new Animation();
const wrapperAnimation = new Animation();

View File

@ -3,11 +3,11 @@ import { Animation } from '../../../index';
/**
* iOS Toast Leave Animation
*/
export default function(
export default function iOSLeaveAnimation(
Animation: Animation,
baseElm: HTMLElement,
position: string
) {
): Animation {
const baseAnimation = new Animation();
const wrapperAnimation = new Animation();