Skip to content

Commit

Permalink
Merge pull request gridstack#2442 from adumesny/master
Browse files Browse the repository at this point in the history
window.getComputedStyle() -> getComputedStyle() shorter code.
  • Loading branch information
adumesny authored Sep 5, 2023
2 parents 6a5e60b + 17ee0ea commit 5df59aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dd-draggable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dd-resizable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
// }
// }
Expand Down

0 comments on commit 5df59aa

Please sign in to comment.