mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-17 07:47:24 +00:00
Support custom HTML element tags for reveal widget
This commit is contained in:
@@ -30,7 +30,11 @@ RevealWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
var domNode = this.document.createElement(this.parseTreeNode.isBlock ? "div" : "span");
|
||||
var tag = this.parseTreeNode.isBlock ? "div" : "span";
|
||||
if($tw.config.htmlUnsafeElements.indexOf(this.revealTag) === -1) {
|
||||
tag = this.revealTag;
|
||||
}
|
||||
var domNode = this.document.createElement(tag);
|
||||
var classes = this["class"].split(" ") || [];
|
||||
classes.push("tc-reveal");
|
||||
domNode.className = classes.join(" ");
|
||||
@@ -83,6 +87,7 @@ Compute the internal state of the widget
|
||||
RevealWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.state = this.getAttribute("state");
|
||||
this.revealTag = this.getAttribute("tag");
|
||||
this.type = this.getAttribute("type");
|
||||
this.text = this.getAttribute("text");
|
||||
this.position = this.getAttribute("position");
|
||||
|
||||
Reference in New Issue
Block a user