mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Messages from the browser process call atom.messageReceivedFromBrowserProcess
This is how we will handle replies from dialogs presented in the browser process.
This commit is contained in:
@@ -8,6 +8,10 @@ atom.sendMessageToBrowserProcess = (name, data, callback) ->
|
||||
messageId = messageIdCounter++
|
||||
data.unshift(messageId)
|
||||
pendingBrowserProcessCallbacks[messageId] = callback
|
||||
originalSendMessageToBrowserProcess(name, data)
|
||||
|
||||
atom.receiveMessageFromBrowserProcess = (name, data) ->
|
||||
console.log "RECEIVE MESSAGE IN JS", name, data
|
||||
|
||||
atom.open = (args...) ->
|
||||
@sendMessageToBrowserProcess('open', args)
|
||||
@@ -15,6 +19,3 @@ atom.open = (args...) ->
|
||||
atom.confirm = (prompt, buttonsAndCallbacks...) ->
|
||||
console.log prompt, buttonsAndCallbacks
|
||||
|
||||
atom.confirm "Are you sure?",
|
||||
"Yes", (-> )
|
||||
"No", (-> )
|
||||
|
||||
Reference in New Issue
Block a user