Browse files

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

… (thanks Mert Torun)
  • Loading branch information...
1 parent 7647ec8 commit ba35e8d3a4949b4c7ea81190b16c6cf1dbfd8c68 @worrydream committed Nov 23, 2011
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"); }
});
}
};

0 comments on commit ba35e8d

Please sign in to comment.