Skip to content

Commit

Permalink
use singular name
Browse files Browse the repository at this point in the history
  • Loading branch information
georgimkv committed May 26, 2022
1 parent c2ea2d5 commit 0a6111d
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions packages/main/src/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,37 +291,28 @@ class Dialog extends Popup {

onEnterDOM() {
super.onEnterDOM();
this._attachScreenResizeHandlers();
this._attachScreenResizeHandler();
}

onExitDOM() {
super.onExitDOM();
this._detachScreenResizeHandlers();
this._detachScreenResizeHandler();
}

/**
* @override
*/
_resize() {
super._resize();

if (this._screenResizeHandlersAttached) {
this._center();
}
this._center();
}

_attachScreenResizeHandlers() {
if (!this._screenResizeHandlersAttached) {
window.addEventListener("resize", this._screenResizeHandler);
this._screenResizeHandlersAttached = true;
}
_attachScreenResizeHandler() {
window.addEventListener("resize", this._screenResizeHandler);
}

_detachScreenResizeHandlers() {
if (this._screenResizeHandlersAttached) {
window.removeEventListener("resize", this._screenResizeHandler);
this._screenResizeHandlersAttached = false;
}
_detachScreenResizeHandler() {
window.removeEventListener("resize", this._screenResizeHandler);
}

_center() {
Expand Down Expand Up @@ -458,7 +449,7 @@ class Dialog extends Popup {
}

_resizeWithEvent(event) {
this._detachScreenResizeHandlers();
this._detachScreenResizeHandler();
this.addEventListener("ui5-before-close", this._revertSize);

const { top, left } = this.getBoundingClientRect(),
Expand Down Expand Up @@ -496,7 +487,7 @@ class Dialog extends Popup {
}

_attachMouseDragHandlers() {
this._detachScreenResizeHandlers();
this._detachScreenResizeHandler();

window.addEventListener("mousemove", this._dragMouseMoveHandler);
window.addEventListener("mouseup", this._dragMouseUpHandler);
Expand Down Expand Up @@ -595,7 +586,7 @@ class Dialog extends Popup {
}

_attachMouseResizeHandlers() {
this._detachScreenResizeHandlers();
this._detachScreenResizeHandler();

window.addEventListener("mousemove", this._resizeMouseMoveHandler);
window.addEventListener("mouseup", this._resizeMouseUpHandler);
Expand Down

0 comments on commit 0a6111d

Please sign in to comment.