From 17ee0eabfd945b0c4844ec69b0b87000e454ef85 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Mon, 4 Sep 2023 17:48:29 -0700 Subject: [PATCH] window.getComputedStyle() -> getComputedStyle() shorter code. --- src/dd-draggable.ts | 2 +- src/dd-resizable.ts | 2 +- src/utils.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dd-draggable.ts b/src/dd-draggable.ts index bee5afd42..dcfc6fce4 100644 --- a/src/dd-draggable.ts +++ b/src/dd-draggable.ts @@ -338,7 +338,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt this.helperContainment = this.helper.parentElement; if (this.helper.style.position !== 'fixed') { this.parentOriginStylePosition = this.helperContainment.style.position; - if (window.getComputedStyle(this.helperContainment).position.match(/static/)) { + if (getComputedStyle(this.helperContainment).position.match(/static/)) { this.helperContainment.style.position = 'relative'; } } diff --git a/src/dd-resizable.ts b/src/dd-resizable.ts index 5fceb9c65..31ef8c6c0 100644 --- a/src/dd-resizable.ts +++ b/src/dd-resizable.ts @@ -217,7 +217,7 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt protected _setupHelper(): DDResizable { this.elOriginStyleVal = DDResizable._originStyleProp.map(prop => this.el.style[prop]); this.parentOriginStylePosition = this.el.parentElement.style.position; - if (window.getComputedStyle(this.el.parentElement).position.match(/static/)) { + if (getComputedStyle(this.el.parentElement).position.match(/static/)) { this.el.parentElement.style.position = 'relative'; } this.el.style.position = 'absolute'; diff --git a/src/utils.ts b/src/utils.ts index 1f3343172..92e47da8f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -481,7 +481,7 @@ export class Utils { } // public static setPositionRelative(el: HTMLElement): void { - // if (!(/^(?:r|a|f)/).test(window.getComputedStyle(el).position)) { + // if (!(/^(?:r|a|f)/).test(getComputedStyle(el).position)) { // el.style.position = "relative"; // } // }