Add style attribute to reveal widget

This commit is contained in:
Jermolene 2015-03-23 15:28:26 +00:00
parent b97336f171
commit bd6472c1d1
2 changed files with 6 additions and 0 deletions

View File

@ -38,6 +38,9 @@ RevealWidget.prototype.render = function(parent,nextSibling) {
var classes = this["class"].split(" ") || [];
classes.push("tc-reveal");
domNode.className = classes.join(" ");
if(this.style) {
domNode.setAttribute("style",this.style);
}
parent.insertBefore(domNode,nextSibling);
this.renderChildren(domNode,null);
if(!domNode.isTiddlyWikiFakeDom && this.type === "popup" && this.isOpen) {
@ -92,6 +95,7 @@ RevealWidget.prototype.execute = function() {
this.text = this.getAttribute("text");
this.position = this.getAttribute("position");
this["class"] = this.getAttribute("class","");
this.style = this.getAttribute("style","");
this["default"] = this.getAttribute("default","");
this.animate = this.getAttribute("animate","no");
this.retain = this.getAttribute("retain","no");

View File

@ -22,6 +22,8 @@ The content of the `<$reveal>` widget is displayed according to the rules given
|tag |Overrides the default HTML element tag (`<div>` in block mode or `<span>` in inline mode) |
|type |The type of matching performed: ''match'', ''nomatch'' or ''popup'' |
|text |The text to match when the type is ''match'' and ''nomatch'' |
|class |An optional CSS class name to be assigned to the HTML element|
|style |An optional CSS style attribute to be assigned to the HTML element |
|position |The position used for the popup when the type is ''popup''. Can be ''left'', ''above'', ''aboveright'', ''right'', ''belowleft'' or ''below'' |
|default |Default value to use when the state tiddler is missing |
|animate |Set to "yes" to animate opening and closure (defaults to "no") |