diff --git a/lib/fdialog.js b/lib/fdialog.js index 0427653..d44d624 100644 --- a/lib/fdialog.js +++ b/lib/fdialog.js @@ -23,7 +23,7 @@ var FDialog = function () { util.inherits(FDialog, events.EventEmitter); -// Exports +// Exports module.exports = FDialog; @@ -74,10 +74,8 @@ FDialog.prototype._createElement = function () { this.element.setAttributeNode(nwsaveas); } else if (this._options.type == 'directory') { - // Future - throw new Error("Not implemented"); - /*var nwdirectory = window.document.createAttribute('nwdirectory'); - this.element.setAttributeNode(nwdirectory);*/ + var nwdirectory = window.document.createAttribute('nwdirectory'); + this.element.setAttributeNode(nwdirectory); } if (this._options.path) { @@ -89,7 +87,7 @@ FDialog.prototype._createElement = function () { } if (this._options.accept) { - + var accept = window.document.createAttribute('accept'); accept.value = this._options.accept.join(','); @@ -107,7 +105,7 @@ FDialog.prototype._createElement = function () { // Methods -FDialog.prototype.initialize = function (options) { +FDialog.prototype.initialize = function (options) { this._options = _.extend({}, defOprions, options); if (typeof this._options.window !== "undefined") @@ -187,7 +185,7 @@ FDialog.prototype.readFile = function (options, cb) { cb(err, body, filepath); }); - }); + }); }; @@ -225,6 +223,6 @@ FDialog.prototype.saveFile = function (data, encoding, options, cb) { }); - }) + }) };