@@ -21,7 +21,6 @@ const TAB_SPACE = ' '; |
21 | 21 | export class CssKeyframesDriver implements AnimationDriver { |
22 | 22 | private _count = 0; |
23 | 23 | private readonly _head: any = document.querySelector('head'); |
24 | | - private _warningIssued = false; |
25 | 24 |
|
26 | 25 | validateStyleProperty(prop: string): boolean { |
27 | 26 | return validateStyleProperty(prop); |
@@ -79,8 +78,8 @@ export class CssKeyframesDriver implements AnimationDriver { |
79 | 78 | animate( |
80 | 79 | element: any, keyframes: ɵStyleData[], duration: number, delay: number, easing: string, |
81 | 80 | previousPlayers: AnimationPlayer[] = [], scrubberAccessRequested?: boolean): AnimationPlayer { |
82 | | - if (scrubberAccessRequested) { |
83 | | - this._notifyFaultyScrubber(); |
| 81 | + if ((typeof ngDevMode === 'undefined' || ngDevMode) && scrubberAccessRequested) { |
| 82 | + notifyFaultyScrubber(); |
84 | 83 | } |
85 | 84 |
|
86 | 85 | const previousCssKeyframePlayers = <CssKeyframesPlayer[]>previousPlayers.filter( |
@@ -117,15 +116,6 @@ export class CssKeyframesDriver implements AnimationDriver { |
117 | 116 | player.onDestroy(() => removeElement(kfElm)); |
118 | 117 | return player; |
119 | 118 | } |
120 | | - |
121 | | - private _notifyFaultyScrubber() { |
122 | | - if (!this._warningIssued) { |
123 | | - console.warn( |
124 | | - '@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n', |
125 | | - ' visit https://bit.ly/IWukam to learn more about using the web-animation-js polyfill.'); |
126 | | - this._warningIssued = true; |
127 | | - } |
128 | | - } |
129 | 119 | } |
130 | 120 |
|
131 | 121 | function flattenKeyframesIntoStyles(keyframes: null|{[key: string]: any}| |
@@ -146,3 +136,12 @@ function flattenKeyframesIntoStyles(keyframes: null|{[key: string]: any}| |
146 | 136 | function removeElement(node: any) { |
147 | 137 | node.parentNode.removeChild(node); |
148 | 138 | } |
| 139 | + |
| 140 | +let warningIssued = false; |
| 141 | +function notifyFaultyScrubber(): void { |
| 142 | + if (warningIssued) return; |
| 143 | + console.warn( |
| 144 | + '@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n', |
| 145 | + ' visit https://bit.ly/IWukam to learn more about using the web-animation-js polyfill.'); |
| 146 | + warningIssued = true; |
| 147 | +} |