Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

TangleKit: TKIf and TKSwitch work both both inline and block elements…

… (thanks Mert Torun)
  • Loading branch information...
commit ba35e8d3a4949b4c7ea81190b16c6cf1dbfd8c68 1 parent 7647ec8
@worrydream authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 TangleKit/TangleKit.js
View
6 TangleKit/TangleKit.js
@@ -26,7 +26,8 @@ Tangle.classes.TKIf = {
update: function (element, value) {
if (this.isInverted) { value = !value; }
- element.style.display = !value ? "none" : "inline"; // todo, block or inline?
+ if (value) { element.style.removeProperty("display"); }
+ else { element.style.display = "none" };
}
};
@@ -43,7 +44,8 @@ Tangle.classes.TKSwitch = {
update: function (element, value) {
element.getChildren().each( function (child, index) {
- child.style.display = (index != value) ? "none" : "inline";
+ if (index != value) { child.style.display = "none"; }
+ else { child.style.removeProperty("display"); }
});
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.