Avoid passing closures to browser when showing dialog.
It's resource-costy.
This commit is contained in:
parent
9091a34675
commit
83debe2e43
1 changed files with 2 additions and 2 deletions
|
@ -51,8 +51,8 @@ createMenu = (items, event) ->
|
|||
showFileChooserDialog = (callback) ->
|
||||
remote = require 'remote'
|
||||
dialog = remote.require 'dialog'
|
||||
dialog.showOpenDialog remote.getCurrentWindow(), null, (files) ->
|
||||
callback pathToHtml5FileObject(files[0]) if files?
|
||||
files = dialog.showOpenDialog remote.getCurrentWindow(), null
|
||||
callback pathToHtml5FileObject files[0] if files?
|
||||
|
||||
pathToHtml5FileObject = (path) ->
|
||||
fs = require 'fs'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue