🐛 Add event handler for window resizing.

Added event handler to solve issues about saving the window dimensions
This commit is contained in:
Xavier Fontes
2017-11-29 15:38:47 +00:00
parent c318d01ef3
commit 0a9437bef2

View File

@@ -9,6 +9,7 @@ class WindowEventHandler {
this.handleFocusNext = this.handleFocusNext.bind(this)
this.handleFocusPrevious = this.handleFocusPrevious.bind(this)
this.handleWindowBlur = this.handleWindowBlur.bind(this)
this.handleWindowResize = this.handleWindowResize.bind(this)
this.handleEnterFullScreen = this.handleEnterFullScreen.bind(this)
this.handleLeaveFullScreen = this.handleLeaveFullScreen.bind(this)
this.handleWindowBeforeunload = this.handleWindowBeforeunload.bind(this)
@@ -51,6 +52,7 @@ class WindowEventHandler {
this.addEventListener(this.window, 'beforeunload', this.handleWindowBeforeunload)
this.addEventListener(this.window, 'focus', this.handleWindowFocus)
this.addEventListener(this.window, 'blur', this.handleWindowBlur)
this.addEventListener(this.window, 'resize', this.handleWindowResize)
this.addEventListener(this.document, 'keyup', this.handleDocumentKeyEvent)
this.addEventListener(this.document, 'keydown', this.handleDocumentKeyEvent)
@@ -189,6 +191,10 @@ class WindowEventHandler {
this.atomEnvironment.storeWindowDimensions()
}
handleWindowResize () {
this.atomEnvironment.storeWindowDimensions()
}
handleEnterFullScreen () {
this.document.body.classList.add('fullscreen')
}