1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-26 22:28:18 +00:00

Browse widget: add support for nwdirectory attribute

This commit is contained in:
Jermolene 2017-10-03 21:52:51 +01:00
parent 49fad6dae9
commit 7bdaabce78

View File

@ -46,10 +46,13 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
if(this.nwsaveas) { if(this.nwsaveas) {
domNode.setAttribute("nwsaveas",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) { if(this.webkitdirectory) {
domNode.setAttribute("webkitdirectory",this.webkitdirectory); domNode.setAttribute("webkitdirectory",this.webkitdirectory);
} }
if(this.nwdirectory) {
domNode.setAttribute("nwdirectory",this.nwdirectory);
}
// Add a click event handler // Add a click event handler
domNode.addEventListener("change",function (event) { domNode.addEventListener("change",function (event) {
if(self.message) { if(self.message) {
@ -81,6 +84,7 @@ BrowseWidget.prototype.execute = function() {
this.tooltip = this.getAttribute("tooltip"); this.tooltip = this.getAttribute("tooltip");
this.nwsaveas = this.getAttribute("nwsaveas"); this.nwsaveas = this.getAttribute("nwsaveas");
this.webkitdirectory = this.getAttribute("webkitdirectory"); this.webkitdirectory = this.getAttribute("webkitdirectory");
this.nwdirectory = this.getAttribute("nwdirectory");
}; };
/* /*