Skip to content

Commit 5df59aa

Browse files
authored
Merge pull request #2442 from adumesny/master
window.getComputedStyle() -> getComputedStyle() shorter code.
2 parents 6a5e60b + 17ee0ea commit 5df59aa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/dd-draggable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
338338
this.helperContainment = this.helper.parentElement;
339339
if (this.helper.style.position !== 'fixed') {
340340
this.parentOriginStylePosition = this.helperContainment.style.position;
341-
if (window.getComputedStyle(this.helperContainment).position.match(/static/)) {
341+
if (getComputedStyle(this.helperContainment).position.match(/static/)) {
342342
this.helperContainment.style.position = 'relative';
343343
}
344344
}

src/dd-resizable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt
217217
protected _setupHelper(): DDResizable {
218218
this.elOriginStyleVal = DDResizable._originStyleProp.map(prop => this.el.style[prop]);
219219
this.parentOriginStylePosition = this.el.parentElement.style.position;
220-
if (window.getComputedStyle(this.el.parentElement).position.match(/static/)) {
220+
if (getComputedStyle(this.el.parentElement).position.match(/static/)) {
221221
this.el.parentElement.style.position = 'relative';
222222
}
223223
this.el.style.position = 'absolute';

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ export class Utils {
481481
}
482482

483483
// public static setPositionRelative(el: HTMLElement): void {
484-
// if (!(/^(?:r|a|f)/).test(window.getComputedStyle(el).position)) {
484+
// if (!(/^(?:r|a|f)/).test(getComputedStyle(el).position)) {
485485
// el.style.position = "relative";
486486
// }
487487
// }

0 commit comments

Comments
 (0)