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[] = []; private actionSheets: ActionSheet[] = [];
@Method() @Method()
create(opts?: ActionSheetOptions) { create(opts?: ActionSheetOptions): Promise<ActionSheet> {
// create ionic's wrapping ion-action-sheet component // create ionic's wrapping ion-action-sheet component
const actionSheet = document.createElement('ion-action-sheet'); const actionSheet = document.createElement('ion-action-sheet');

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Action Sheet Enter Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Action Sheet Leave Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

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

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Alert Enter Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Alert Leave Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

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

View File

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

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Loading Enter Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Loading Leave Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Modal Enter Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Modal Leave Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

@ -4,7 +4,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Popover Enter Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

@ -3,7 +3,7 @@ import { Animation } from '../../../index';
/** /**
* iOS Popover Leave Animation * 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 baseAnimation = new Animation();
const backdropAnimation = new Animation(); const backdropAnimation = new Animation();

View File

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

View File

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

View File

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