fix(animation): change animate to willAnimate

Closes #13565
This commit is contained in:
mhartington
2018-01-08 14:24:37 -05:00
parent 363b471aee
commit b31591b371
16 changed files with 107 additions and 107 deletions

View File

@ -98,7 +98,6 @@ declare global {
} }
namespace JSXElements { namespace JSXElements {
export interface IonActionSheetAttributes extends HTMLAttributes { export interface IonActionSheetAttributes extends HTMLAttributes {
animate?: boolean;
buttons?: ActionSheetButton[]; buttons?: ActionSheetButton[];
cssClass?: string; cssClass?: string;
enableBackdropDismiss?: boolean; enableBackdropDismiss?: boolean;
@ -107,6 +106,7 @@ declare global {
subTitle?: string; subTitle?: string;
title?: string; title?: string;
translucent?: boolean; translucent?: boolean;
willAnimate?: boolean;
} }
} }
} }
@ -166,7 +166,6 @@ declare global {
} }
namespace JSXElements { namespace JSXElements {
export interface IonAlertAttributes extends HTMLAttributes { export interface IonAlertAttributes extends HTMLAttributes {
animate?: boolean;
buttons?: AlertButton[]; buttons?: AlertButton[];
cssClass?: string; cssClass?: string;
enableBackdropDismiss?: boolean; enableBackdropDismiss?: boolean;
@ -177,6 +176,7 @@ declare global {
subTitle?: string; subTitle?: string;
title?: string; title?: string;
translucent?: boolean; translucent?: boolean;
willAnimate?: boolean;
} }
} }
} }
@ -1517,7 +1517,6 @@ declare global {
} }
namespace JSXElements { namespace JSXElements {
export interface IonLoadingAttributes extends HTMLAttributes { export interface IonLoadingAttributes extends HTMLAttributes {
animate?: boolean;
content?: string; content?: string;
cssClass?: string; cssClass?: string;
dismissOnPageChange?: boolean; dismissOnPageChange?: boolean;
@ -1527,6 +1526,7 @@ declare global {
showBackdrop?: boolean; showBackdrop?: boolean;
spinner?: string; spinner?: string;
translucent?: boolean; translucent?: boolean;
willAnimate?: boolean;
} }
} }
} }
@ -1653,7 +1653,6 @@ declare global {
} }
namespace JSXElements { namespace JSXElements {
export interface IonModalAttributes extends HTMLAttributes { export interface IonModalAttributes extends HTMLAttributes {
animate?: boolean;
color?: string; color?: string;
component?: any; component?: any;
cssClass?: string; cssClass?: string;
@ -1665,6 +1664,7 @@ declare global {
modalId?: number; modalId?: number;
mode?: string; mode?: string;
showBackdrop?: boolean; showBackdrop?: boolean;
willAnimate?: boolean;
} }
} }
} }
@ -1880,7 +1880,6 @@ declare global {
} }
namespace JSXElements { namespace JSXElements {
export interface IonPickerAttributes extends HTMLAttributes { export interface IonPickerAttributes extends HTMLAttributes {
animate?: boolean;
buttons?: PickerButton[]; buttons?: PickerButton[];
columns?: PickerColumn[]; columns?: PickerColumn[];
content?: string; content?: string;
@ -1892,6 +1891,7 @@ declare global {
leaveAnimation?: AnimationBuilder; leaveAnimation?: AnimationBuilder;
pickerId?: string; pickerId?: string;
showBackdrop?: boolean; showBackdrop?: boolean;
willAnimate?: boolean;
} }
} }
} }
@ -1951,7 +1951,6 @@ declare global {
} }
namespace JSXElements { namespace JSXElements {
export interface IonPopoverAttributes extends HTMLAttributes { export interface IonPopoverAttributes extends HTMLAttributes {
animate?: boolean;
color?: string; color?: string;
component?: string; component?: string;
cssClass?: string; cssClass?: string;
@ -1965,6 +1964,7 @@ declare global {
popoverId?: string; popoverId?: string;
showBackdrop?: boolean; showBackdrop?: boolean;
translucent?: boolean; translucent?: boolean;
willAnimate?: boolean;
} }
} }
} }
@ -3003,7 +3003,6 @@ declare global {
} }
namespace JSXElements { namespace JSXElements {
export interface IonToastAttributes extends HTMLAttributes { export interface IonToastAttributes extends HTMLAttributes {
animate?: boolean;
closeButtonText?: string; closeButtonText?: string;
cssClass?: string; cssClass?: string;
dismissOnPageChange?: boolean; dismissOnPageChange?: boolean;
@ -3015,6 +3014,7 @@ declare global {
showCloseButton?: boolean; showCloseButton?: boolean;
toastId?: string; toastId?: string;
translucent?: boolean; translucent?: boolean;
willAnimate?: boolean;
} }
} }
} }

View File

@ -104,7 +104,7 @@ export class ActionSheet {
/** /**
* Enable action-sheet animations. If false, action-sheet will not animate in * Enable action-sheet animations. If false, action-sheet will not animate in
*/ */
@Prop() animate: boolean = true; @Prop() willAnimate: boolean = true;
/** /**
* Animation to use when the action-sheet is created * Animation to use when the action-sheet is created
@ -138,7 +138,7 @@ export class ActionSheet {
this.animation = animation; this.animation = animation;
// Check if prop animate is false or if the config for animate is defined/false // Check if prop animate is false or if the config for animate is defined/false
if (!this.animate || (isDef(this.config.get('animate')) && this.config.get('animate') === false)) { if (!this.willAnimate || (isDef(this.config.get('willAnimate')) && this.config.get('willAnimate') === false)) {
// if the duration is 0, it won't actually animate I don't think // if the duration is 0, it won't actually animate I don't think
// TODO - validate this // TODO - validate this
this.animation = animation.duration(0); this.animation = animation.duration(0);
@ -168,7 +168,7 @@ export class ActionSheet {
return this.animationCtrl.create(animationBuilder, this.el).then(animation => { return this.animationCtrl.create(animationBuilder, this.el).then(animation => {
this.animation = animation; this.animation = animation;
if (!this.animate || (isDef(this.config.get('animate')) && this.config.get('animate') === false)) { if (!this.willAnimate || (isDef(this.config.get('willAnimate')) && this.config.get('willAnimate') === false)) {
this.animation = animation.duration(0); this.animation = animation.duration(0);
} }

View File

@ -7,13 +7,6 @@
## Properties ## Properties
#### animate
boolean
Enable action-sheet animations. If false, action-sheet will not animate in
#### buttons #### buttons
any any
@ -70,15 +63,15 @@ boolean
If true, action-sheet will become translucent. Requires support for backdrop-filters. If true, action-sheet will become translucent. Requires support for backdrop-filters.
#### willAnimate
boolean
Enable action-sheet animations. If false, action-sheet will not animate in
## Attributes ## Attributes
#### animate
boolean
Enable action-sheet animations. If false, action-sheet will not animate in
#### buttons #### buttons
any any
@ -135,6 +128,13 @@ boolean
If true, action-sheet will become translucent. Requires support for backdrop-filters. If true, action-sheet will become translucent. Requires support for backdrop-filters.
#### willAnimate
boolean
Enable action-sheet animations. If false, action-sheet will not animate in
## Events ## Events
#### ionActionSheetDidDismiss #### ionActionSheetDidDismiss

View File

@ -110,7 +110,7 @@ export class Alert {
/** /**
* Enable alert animations. If false, alert will not animate in * Enable alert animations. If false, alert will not animate in
*/ */
@Prop() animate: boolean = true; @Prop() willAnimate: boolean = true;
/** /**
* Animation to be used when the alert is shown * Animation to be used when the alert is shown
@ -140,7 +140,7 @@ export class Alert {
// build the animation and kick it off // build the animation and kick it off
return this.animationCtrl.create(animationBuilder, this.el).then(animation => { return this.animationCtrl.create(animationBuilder, this.el).then(animation => {
this.animation = animation; this.animation = animation;
if (!this.animate) { if (!this.willAnimate) {
// if the duration is 0, it won't actually animate I don't think // if the duration is 0, it won't actually animate I don't think
// TODO - validate this // TODO - validate this
this.animation = animation.duration(0); this.animation = animation.duration(0);

View File

@ -7,13 +7,6 @@
## Properties ## Properties
#### animate
boolean
Enable alert animations. If false, alert will not animate in
#### buttons #### buttons
any any
@ -84,15 +77,15 @@ boolean
If true, alert will become translucent. Requires support for backdrop-filters. If true, alert will become translucent. Requires support for backdrop-filters.
#### willAnimate
boolean
Enable alert animations. If false, alert will not animate in
## Attributes ## Attributes
#### animate
boolean
Enable alert animations. If false, alert will not animate in
#### buttons #### buttons
any any
@ -163,6 +156,13 @@ boolean
If true, alert will become translucent. Requires support for backdrop-filters. If true, alert will become translucent. Requires support for backdrop-filters.
#### willAnimate
boolean
Enable alert animations. If false, alert will not animate in
## Events ## Events
#### ionAlertDidDismiss #### ionAlertDidDismiss

View File

@ -116,7 +116,7 @@ export class Loading {
/** /**
* Toggles whether animation should occur or not * Toggles whether animation should occur or not
*/ */
@Prop() animate: boolean = true; @Prop() willAnimate: boolean = true;
/** /**
* Present a loading overlay after it has been created * Present a loading overlay after it has been created
@ -138,7 +138,7 @@ export class Loading {
// build the animation and kick it off // build the animation and kick it off
return this.animationCtrl.create(animationBuilder, this.el).then(animation => { return this.animationCtrl.create(animationBuilder, this.el).then(animation => {
this.animation = animation; this.animation = animation;
if (!this.animate) { if (!this.willAnimate) {
// if the duration is 0, it won't actually animate I don't think // if the duration is 0, it won't actually animate I don't think
// TODO - validate this // TODO - validate this
this.animation = animation.duration(0); this.animation = animation.duration(0);
@ -171,7 +171,7 @@ export class Loading {
return this.animationCtrl.create(animationBuilder, this.el).then(animation => { return this.animationCtrl.create(animationBuilder, this.el).then(animation => {
this.animation = animation; this.animation = animation;
if (!this.animate) { if (!this.willAnimate) {
// if the duration is 0, it won't actually animate I don't think // if the duration is 0, it won't actually animate I don't think
// TODO - validate this // TODO - validate this
this.animation = animation.duration(0); this.animation = animation.duration(0);

View File

@ -7,13 +7,6 @@
## Properties ## Properties
#### animate
boolean
Toggles whether animation should occur or not
#### content #### content
string string
@ -75,15 +68,15 @@ boolean
If true, the background will be translucent. Browser support for backdrop-filter is required for the full effect If true, the background will be translucent. Browser support for backdrop-filter is required for the full effect
#### willAnimate
boolean
Toggles whether animation should occur or not
## Attributes ## Attributes
#### animate
boolean
Toggles whether animation should occur or not
#### content #### content
string string
@ -145,6 +138,13 @@ boolean
If true, the background will be translucent. Browser support for backdrop-filter is required for the full effect If true, the background will be translucent. Browser support for backdrop-filter is required for the full effect
#### willAnimate
boolean
Toggles whether animation should occur or not
## Events ## Events
#### ionLoadingDidDismiss #### ionLoadingDidDismiss

View File

@ -78,7 +78,7 @@ export class Modal {
@Prop() enterAnimation: AnimationBuilder; @Prop() enterAnimation: AnimationBuilder;
@Prop() leaveAnimation: AnimationBuilder; @Prop() leaveAnimation: AnimationBuilder;
@Prop() animate: boolean = true; @Prop() willAnimate: boolean = true;
@Prop({ mutable: true }) delegate: FrameworkDelegate; @Prop({ mutable: true }) delegate: FrameworkDelegate;
private animation: Animation; private animation: Animation;
@ -119,7 +119,7 @@ export class Modal {
return this.animationCtrl.create(animationBuilder, this.el) return this.animationCtrl.create(animationBuilder, this.el)
.then(animation => { .then(animation => {
this.animation = animation; this.animation = animation;
if (!this.animate) this.animation = animation.duration(0); if (!this.willAnimate) this.animation = animation.duration(0);
return playAnimationAsync(animation); return playAnimationAsync(animation);
}) })
.then((animation) => { .then((animation) => {
@ -147,7 +147,7 @@ export class Modal {
return this.animationCtrl.create(animationBuilder, this.el) return this.animationCtrl.create(animationBuilder, this.el)
.then(animation => { .then(animation => {
this.animation = animation; this.animation = animation;
if (!this.animate) { if (!this.willAnimate) {
this.animation = animation.duration(0); this.animation = animation.duration(0);
} }
return playAnimationAsync(animation); return playAnimationAsync(animation);

View File

@ -7,11 +7,6 @@
## Properties ## Properties
#### animate
boolean
#### color #### color
string string
@ -67,13 +62,13 @@ string
boolean boolean
#### willAnimate
boolean
## Attributes ## Attributes
#### animate
boolean
#### color #### color
string string
@ -129,6 +124,11 @@ string
boolean boolean
#### willAnimate
boolean
## Events ## Events
#### ionModalDidDismiss #### ionModalDidDismiss

View File

@ -36,7 +36,7 @@
await modalController.componentOnReady(); await modalController.componentOnReady();
// create component to open // create component to open
const element = document.createElement('div'); const element = document.createElement('ion-page');
element.innerHTML = ` element.innerHTML = `
<ion-header> <ion-header>
<ion-toolbar> <ion-toolbar>

View File

@ -78,7 +78,7 @@ export class Picker {
@Prop() pickerId: string; @Prop() pickerId: string;
@Prop() showBackdrop: boolean = true; @Prop() showBackdrop: boolean = true;
@Prop() enableBackdropDismiss: boolean = true; @Prop() enableBackdropDismiss: boolean = true;
@Prop() animate: boolean; @Prop() willAnimate: boolean = true;
@Prop() buttons: PickerButton[] = []; @Prop() buttons: PickerButton[] = [];
@Prop() columns: PickerColumn[] = []; @Prop() columns: PickerColumn[] = [];
@ -100,7 +100,7 @@ export class Picker {
// build the animation and kick it off // build the animation and kick it off
return this.animationCtrl.create(animationBuilder, this.el).then(animation => { return this.animationCtrl.create(animationBuilder, this.el).then(animation => {
this.animation = animation; this.animation = animation;
if (!this.animate) { if (!this.willAnimate) {
// if the duration is 0, it won't actually animate I don't think // if the duration is 0, it won't actually animate I don't think
// TODO - validate this // TODO - validate this
this.animation = animation.duration(0); this.animation = animation.duration(0);

View File

@ -7,11 +7,6 @@
## Properties ## Properties
#### animate
boolean
#### buttons #### buttons
any any
@ -67,13 +62,13 @@ string
boolean boolean
#### willAnimate
boolean
## Attributes ## Attributes
#### animate
boolean
#### buttons #### buttons
any any
@ -129,6 +124,11 @@ string
boolean boolean
#### willAnimate
boolean
## Events ## Events
#### ionPickerDidDismiss #### ionPickerDidDismiss

View File

@ -79,7 +79,7 @@ export class Popover {
@Prop() popoverId: string; @Prop() popoverId: string;
@Prop() showBackdrop: boolean = true; @Prop() showBackdrop: boolean = true;
@Prop() translucent: boolean = false; @Prop() translucent: boolean = false;
@Prop() animate: boolean = true; @Prop() willAnimate: boolean = true;
@Prop({ mutable: true }) delegate: FrameworkDelegate; @Prop({ mutable: true }) delegate: FrameworkDelegate;
private animation: Animation; private animation: Animation;
@ -120,7 +120,7 @@ export class Popover {
}) })
.then((animation) => { .then((animation) => {
this.animation = animation; this.animation = animation;
if (!this.animate) this.animation = animation.duration(0); if (!this.willAnimate) this.animation = animation.duration(0);
return playAnimationAsync(animation); return playAnimationAsync(animation);
}) })
.then((animation) => { .then((animation) => {

View File

@ -7,11 +7,6 @@
## Properties ## Properties
#### animate
boolean
#### color #### color
string string
@ -77,13 +72,13 @@ boolean
boolean boolean
#### willAnimate
boolean
## Attributes ## Attributes
#### animate
boolean
#### color #### color
string string
@ -149,6 +144,11 @@ boolean
boolean boolean
#### willAnimate
boolean
## Events ## Events
#### ionPopoverDidDismiss #### ionPopoverDidDismiss

View File

@ -7,11 +7,6 @@
## Properties ## Properties
#### animate
boolean
#### closeButtonText #### closeButtonText
string string
@ -67,13 +62,13 @@ string
boolean boolean
#### willAnimate
boolean
## Attributes ## Attributes
#### animate
boolean
#### closeButtonText #### closeButtonText
string string
@ -129,6 +124,11 @@ string
boolean boolean
#### willAnimate
boolean
## Events ## Events
#### ionToastDidDismiss #### ionToastDidDismiss

View File

@ -71,7 +71,7 @@ export class Toast {
@Prop() position: string; @Prop() position: string;
@Prop() translucent: boolean = false; @Prop() translucent: boolean = false;
@Prop() toastId: string; @Prop() toastId: string;
@Prop() animate: boolean = true; @Prop() willAnimate: boolean = true;
@Prop() enterAnimation: AnimationBuilder; @Prop() enterAnimation: AnimationBuilder;
@Prop() leaveAnimation: AnimationBuilder; @Prop() leaveAnimation: AnimationBuilder;
@ -90,7 +90,7 @@ export class Toast {
// build the animation and kick it off // build the animation and kick it off
return this.animationCtrl.create(animationBuilder, this.el, this.position).then(animation => { return this.animationCtrl.create(animationBuilder, this.el, this.position).then(animation => {
this.animation = animation; this.animation = animation;
if (!this.animate) { if (!this.willAnimate) {
// if the duration is 0, it won't actually animate I don't think // if the duration is 0, it won't actually animate I don't think
// TODO - validate this // TODO - validate this
this.animation = animation.duration(0); this.animation = animation.duration(0);