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) ->
|
showFileChooserDialog = (callback) ->
|
||||||
remote = require 'remote'
|
remote = require 'remote'
|
||||||
dialog = remote.require 'dialog'
|
dialog = remote.require 'dialog'
|
||||||
dialog.showOpenDialog remote.getCurrentWindow(), null, (files) ->
|
files = dialog.showOpenDialog remote.getCurrentWindow(), null
|
||||||
callback pathToHtml5FileObject(files[0]) if files?
|
callback pathToHtml5FileObject files[0] if files?
|
||||||
|
|
||||||
pathToHtml5FileObject = (path) ->
|
pathToHtml5FileObject = (path) ->
|
||||||
fs = require 'fs'
|
fs = require 'fs'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue