Add focus() and blur() for FakeWindow
This commit is contained in:
parent
64ce44d341
commit
bdad1d1753
2 changed files with 10 additions and 0 deletions
|
@ -58,3 +58,7 @@ ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', (event, args...) ->
|
|||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSE', (event, args...) ->
|
||||
guest = removeGuest args...
|
||||
guest.destroy()
|
||||
|
||||
ipc.on 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', (event, guestId, method, args...) ->
|
||||
guest = BrowserWindow.windows.get guestId
|
||||
guest[method] args...
|
||||
|
|
|
@ -9,6 +9,12 @@ class FakeWindow
|
|||
close: ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_CLOSE', @embedderId, @guestId
|
||||
|
||||
focus: ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', @guestId, 'focus'
|
||||
|
||||
blur: ->
|
||||
ipc.send 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_METHOD', @guestId, 'blur'
|
||||
|
||||
unless process.guestInstanceId?
|
||||
# Override default window.close.
|
||||
window.close = ->
|
||||
|
|
Loading…
Reference in a new issue