Browse Source
Merge pull request #11763 from ArtemDzhereleiko/AD/fix-scada-pattern/chrome127
Fixed pattern animation for chrome 127
pull/11795/head
Igor Kulikov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
16 additions and
0 deletions
-
ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts
|
|
@ -1168,6 +1168,22 @@ class CssScadaSymbolAnimation implements ScadaSymbolAnimation { |
|
|
private element: Element, |
|
|
private element: Element, |
|
|
duration = 1000) { |
|
|
duration = 1000) { |
|
|
this._duration = duration; |
|
|
this._duration = duration; |
|
|
|
|
|
this.fixPatternAnimationForChromeBelow128(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fixPatternAnimationForChromeBelow128(): void { |
|
|
|
|
|
try { |
|
|
|
|
|
const userAgent = window.navigator.userAgent; |
|
|
|
|
|
if (+(/Chrome\/(\d+)/i.exec(userAgent)[1]) <= 127) { |
|
|
|
|
|
if (this.svgShape.defs().findOne('pattern') && !this.svgShape.defs().findOne('pattern.empty-animation')) { |
|
|
|
|
|
this.svgShape.defs().add(SVG('<pattern class="empty-animation"></pattern>')); |
|
|
|
|
|
this.svgShape.style() |
|
|
|
|
|
.rule('.' + 'empty-animation', |
|
|
|
|
|
{'animation-name': 'empty-animation', 'animation-duration': '1000ms', 'animation-iteration-count': 'infinite'}) |
|
|
|
|
|
.addText('@keyframes empty-animation {0% {<!--opacity:1;-->}100% {<!--opacity:1;-->}}'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} catch (e) {} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public running(): boolean { |
|
|
public running(): boolean { |
|
|
|