Listen to window focusin/focusout instead of focus/blur

This appears to be needed by jquery 2.0+ so the specs
can correctly simulate these events using trigger.
This commit is contained in:
Kevin Sawicki 2013-10-16 10:35:26 -07:00
parent 7149ade43c
commit 607ed972c1
2 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ describe "Window", ->
describe "when the window is blurred", ->
beforeEach ->
$(window).trigger 'blur'
$(window).trigger 'focusout'
afterEach ->
$('body').removeClass('is-blurred')
@ -34,7 +34,7 @@ describe "Window", ->
describe "when the window is focused again", ->
it "removes the .is-blurred class from the body", ->
$(window).trigger 'focus'
$(window).trigger 'focusin'
expect($("body")).not.toHaveClass("is-blurred")
describe "window:close event", ->

View File

@ -19,9 +19,9 @@ class WindowEventHandler
@subscribe ipc, 'context-command', (command, args...) ->
$(atom.contextMenu.activeElement).trigger(command, args...)
@subscribe $(window), 'focus', -> $("body").removeClass('is-blurred')
@subscribe $(window), 'focusin', -> $("body").removeClass('is-blurred')
@subscribe $(window), 'blur', -> $("body").addClass('is-blurred')
@subscribe $(window), 'focusout', -> $("body").addClass('is-blurred')
@subscribe $(window), 'window:open-path', (event, {pathToOpen, initialLine}) ->
unless fsUtils.isDirectorySync(pathToOpen)