node-webkit-fdialogs
node-webkit-fdialogs copied to clipboard
Window context in >= NW.js 0.13
With the new NW.js the dialog is never opened, now it is mandatory to specify the NW.js window object as option because the DOM window of node context is on a separate context and the browser context is not accesible.
So you can not use the exported module functions
fdialogs.readFile(function (err, content, path) {
});
fdialogs.saveFile(buff, function (err, path) {
});
You must use the exported FDialog in this way:
For save dialog:
var saveDialog = new fdialogs.FDialog({
type: 'save',
window: nw.Window.get().window
});
saveDialog.saveFile(buff, function (err, path) {
});
For open dialog:
var openDialog = new fdialogs.FDialog({
type: 'open',
window: nw.Window.get().window
});
openDialog.readFile(function (err, content, path) {
});