1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-02-23 18:39:50 +00:00

Compare commits

...

3 Commits

5 changed files with 28 additions and 10 deletions

View File

@@ -212,8 +212,8 @@ ZoominListView.prototype.remove = function(widget) {
]);
setTimeout(function() {
$tw.utils.removeStyles(toWidgetDomNode, ["transformOrigin", "transform", "transition", "opacity", "zIndex"]);
removeElement();
}, duration);
setTimeout(removeElement,duration);
// Now the tiddler we're going back to
if(toWidgetDomNode) {
$tw.utils.setStyle(toWidgetDomNode,[

View File

@@ -30,8 +30,10 @@ Remove style properties of an element
styleProperties: ordered array of string property names
*/
exports.removeStyles = function(element, styleProperties) {
for(var i=0; i<styleProperties.length; i++) {
element.style.removeProperty($tw.utils.convertStyleNameToPropertyName(styleProperties[i]));
if(element) {
for(var i=0; i<styleProperties.length; i++) {
element.style.removeProperty($tw.utils.convertStyleNameToPropertyName(styleProperties[i]));
}
}
};

View File

@@ -415,9 +415,10 @@ Widget.prototype.computeAttribute = function(attribute,options) {
value;
if(attribute.type === "filtered") {
value = this.wiki.filterTiddlers(attribute.filter,this);
if(!options.asList) {
value = value[0] || "";
if(!value.length) {
value = [""];
}
value = options.asList ? value : value[0];
} else if(attribute.type === "indirect") {
value = this.wiki.getTextReference(attribute.textReference,"",this.getVariable("currentTiddler"));
if(value && options.asList) {

View File

@@ -5,11 +5,6 @@ tags: [[$:/tags/wiki-test-spec]]
title: Output
\procedure testproc()
This is ''wikitext''
\end
<$tiddler tiddler="Data">
<$transclude $index="testindex"/>
-

View File

@@ -0,0 +1,20 @@
title: Transclude/MissingTiddlerAttributeFiltered
description: Missing Tiddler Attribute Filtered
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<$transclude tiddler={{{ [[sometiddler]get[nosuchfield]] }}}/>
-
<$transclude tiddler="">fallback content</$transclude>
-
<$transclude tiddler={{{ [[sometiddler]get[nosuchfield]] }}}>fallback content</$transclude>
+
title: ExpectedResult
<p>
-
fallback content
-
fallback content</p>