mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Add nwsaveas and param attributes to browse widget
These are for TiddlyDesktop, and only work under node-webkit
This commit is contained in:
parent
3657bbe920
commit
0fdfbc482c
@ -42,10 +42,13 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
|
||||
if(this.tooltip) {
|
||||
domNode.setAttribute("title",this.tooltip);
|
||||
}
|
||||
if(this.nwsaveas) {
|
||||
domNode.setAttribute("nwsaveas",this.nwsaveas);
|
||||
}
|
||||
// Add a click event handler
|
||||
domNode.addEventListener("change",function (event) {
|
||||
if(self.message) {
|
||||
self.dispatchEvent({type: self.message, param: event.target.files});
|
||||
self.dispatchEvent({type: self.message, param: self.param, files: event.target.files});
|
||||
} else {
|
||||
self.wiki.readFiles(event.target.files,function(tiddlerFieldsArray) {
|
||||
self.dispatchEvent({type: "tm-import-tiddlers", param: JSON.stringify(tiddlerFieldsArray)});
|
||||
@ -65,7 +68,9 @@ Compute the internal state of the widget
|
||||
BrowseWidget.prototype.execute = function() {
|
||||
this.browseMultiple = this.getAttribute("multiple");
|
||||
this.message = this.getAttribute("message");
|
||||
this.param = this.getAttribute("param");
|
||||
this.tooltip = this.getAttribute("tooltip");
|
||||
this.nwsaveas = this.getAttribute("nwsaveas");
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user