mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-30 17:38:02 +00:00
Removed ability for widgets to not generate any elements
It interfered with the refresh mechanism
This commit is contained in:
@@ -114,8 +114,6 @@ ElementRenderer.prototype.getAttribute = function(name,defaultValue) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ElementRenderer.prototype.render = function(type) {
|
ElementRenderer.prototype.render = function(type) {
|
||||||
// Check if our widget is providing an element
|
|
||||||
if(this.widget.tag) {
|
|
||||||
var isHtml = type === "text/html",
|
var isHtml = type === "text/html",
|
||||||
output = [],attr,a,v;
|
output = [],attr,a,v;
|
||||||
if(isHtml) {
|
if(isHtml) {
|
||||||
@@ -158,10 +156,6 @@ ElementRenderer.prototype.render = function(type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return output.join("");
|
return output.join("");
|
||||||
} else {
|
|
||||||
// Just render our first child if we're not generating an element
|
|
||||||
return this.widget.children[0].render(type);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ElementRenderer.prototype.renderInDom = function() {
|
ElementRenderer.prototype.renderInDom = function() {
|
||||||
|
@@ -22,7 +22,10 @@ var LinkViewer = function(viewWidget,tiddler,field,value) {
|
|||||||
LinkViewer.prototype.render = function() {
|
LinkViewer.prototype.render = function() {
|
||||||
var text = this.value === undefined ? "" : this.value;
|
var text = this.value === undefined ? "" : this.value;
|
||||||
// Indicate that we're not generating an element
|
// Indicate that we're not generating an element
|
||||||
this.viewWidget.tag = undefined;
|
this.viewWidget.tag = this.viewWidget.renderer.parseTreeNode.isBlock ? "div" : "span";
|
||||||
|
this.viewWidget.attributes = {
|
||||||
|
"class": "tw-view-link"
|
||||||
|
};
|
||||||
this.viewWidget.children = this.viewWidget.renderer.renderTree.createRenderers(this.viewWidget.renderer.renderContext,[{
|
this.viewWidget.children = this.viewWidget.renderer.renderTree.createRenderers(this.viewWidget.renderer.renderContext,[{
|
||||||
type: "element",
|
type: "element",
|
||||||
tag: "$link",
|
tag: "$link",
|
||||||
|
Reference in New Issue
Block a user