UNPKG

936 BJavaScriptView Raw
1import { __decorate } from "tslib";
2import { singleton } from 'mana-syringe';
3
4var CSSPropertyOffsetPath =
5/** @class */
6function () {
7 function CSSPropertyOffsetPath() {}
8
9 CSSPropertyOffsetPath.prototype.calculator = function (name, oldOffsetPath, newOffsetPath, object) {
10 // clear ref to old clip path
11 if (oldOffsetPath && oldOffsetPath !== newOffsetPath && oldOffsetPath.style.offsetPathTargets) {
12 var index = oldOffsetPath.style.offsetPathTargets.indexOf(object);
13 oldOffsetPath.style.offsetPathTargets.splice(index, 1);
14 }
15
16 if (newOffsetPath) {
17 if (!newOffsetPath.style.offsetPathTargets) {
18 newOffsetPath.style.offsetPathTargets = [];
19 }
20
21 newOffsetPath.style.offsetPathTargets.push(object);
22 }
23
24 return newOffsetPath;
25 };
26
27 CSSPropertyOffsetPath = __decorate([singleton()], CSSPropertyOffsetPath);
28 return CSSPropertyOffsetPath;
29}();
30
31export { CSSPropertyOffsetPath };
\No newline at end of file