mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-28 17:13:45 +03:00
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:
parent
7149ade43c
commit
607ed972c1
@ -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", ->
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user