check for on method

during `window-event-handler-spec`, `applicationDelegate.getCurrentWindow`
seems to return a truncated version of a browserWindow object, which does not include the `on` method
This commit is contained in:
Philipp Brumm
2016-07-06 12:37:50 +02:00
parent e7ff266a57
commit 974995f50a

View File

@@ -24,8 +24,8 @@ class WindowEventHandler
@subscriptions.add listen(@document, 'submit', 'form', @handleFormSubmit)
browserWindow = @applicationDelegate.getCurrentWindow()
browserWindow.on 'enter-full-screen', @handleEnterFullScreen
browserWindow.on 'leave-full-screen', @handleLeaveFullScreen
browserWindow.on? 'enter-full-screen', @handleEnterFullScreen
browserWindow.on? 'leave-full-screen', @handleLeaveFullScreen
@subscriptions.add @atomEnvironment.commands.add @window,
'window:toggle-full-screen': @handleWindowToggleFullScreen