From 0e396083beb34bd0ff0d50c9ddf63742495907ef Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Fri, 27 Sep 2024 18:24:59 +0300 Subject: [PATCH] UI: Fixed pattern animation for chrome 127 --- .../widget/lib/scada/scada-symbol.models.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts index f15e7a30c7..da41864b94 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/scada/scada-symbol.models.ts @@ -628,6 +628,20 @@ export class ScadaSymbolObject { } this.svgShape = SVG().svg(svgContent); + + try { + const userAgent = window.navigator.userAgent; + if (+(/Chrome\/(\d+)/i.exec(userAgent)[1]) <= 127) { + if (this.svgShape.defs().findOne('pattern')) { + this.svgShape.defs().add(SVG('>')); + this.svgShape.style() + .rule('.' + 'empty-animation', + {'animation-name': 'empty-animation', 'animation-duration': '1000ms', 'animation-iteration-count': 'infinite'}) + .addText('@keyframes empty-animation {0% {}100% {}}'); + } + } + } catch (e) {} + this.svgShape.node.style.overflow = 'hidden'; this.svgShape.node.style.position = 'absolute'; this.svgShape.node.style['user-select'] = 'none';