From 7bdaabce78b86698dfed6e93fbabc624b79bf650 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 3 Oct 2017 21:52:51 +0100 Subject: [PATCH] Browse widget: add support for nwdirectory attribute --- core/modules/widgets/browse.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/browse.js b/core/modules/widgets/browse.js index ddb39d628..ed57e4c33 100644 --- a/core/modules/widgets/browse.js +++ b/core/modules/widgets/browse.js @@ -46,10 +46,13 @@ BrowseWidget.prototype.render = function(parent,nextSibling) { if(this.nwsaveas) { domNode.setAttribute("nwsaveas",this.nwsaveas); } - // Nw.js supports "webkitdirectory" to allow a directory to be selected + // Nw.js supports "webkitdirectory" and "nwdirectory" to allow a directory to be selected if(this.webkitdirectory) { domNode.setAttribute("webkitdirectory",this.webkitdirectory); } + if(this.nwdirectory) { + domNode.setAttribute("nwdirectory",this.nwdirectory); + } // Add a click event handler domNode.addEventListener("change",function (event) { if(self.message) { @@ -81,6 +84,7 @@ BrowseWidget.prototype.execute = function() { this.tooltip = this.getAttribute("tooltip"); this.nwsaveas = this.getAttribute("nwsaveas"); this.webkitdirectory = this.getAttribute("webkitdirectory"); + this.nwdirectory = this.getAttribute("nwdirectory"); }; /*