Always switch out Text elements
This commit is contained in:
parent
dd9c90d457
commit
ef2b38fe11
2 changed files with 7 additions and 2 deletions
|
@ -96,7 +96,7 @@ Elm.Native.Text.make = function(elm) {
|
||||||
var raw = {
|
var raw = {
|
||||||
ctor:'RawHtml',
|
ctor:'RawHtml',
|
||||||
html: '<span style="text-align:' + align + ';">' + text + '</span>',
|
html: '<span style="text-align:' + align + ';">' + text + '</span>',
|
||||||
guid: '0',
|
guid: null,
|
||||||
args: [],
|
args: [],
|
||||||
};
|
};
|
||||||
var pos = A2(Utils.htmlHeight, 0, raw);
|
var pos = A2(Utils.htmlHeight, 0, raw);
|
||||||
|
|
|
@ -205,6 +205,11 @@ function update(node, curr, next) {
|
||||||
switch(nextE.ctor) {
|
switch(nextE.ctor) {
|
||||||
case "Spacer": break;
|
case "Spacer": break;
|
||||||
case "RawHtml":
|
case "RawHtml":
|
||||||
|
// only markdown blocks have guids, so this must be a text block
|
||||||
|
if (nextE.guid === null) {
|
||||||
|
node.innerHTML = nextE.html;
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (nextE.guid !== currE.guid) {
|
if (nextE.guid !== currE.guid) {
|
||||||
node.parentNode.replaceChild(render(next),node);
|
node.parentNode.replaceChild(render(next),node);
|
||||||
return true;
|
return true;
|
||||||
|
@ -267,7 +272,7 @@ function update(node, curr, next) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Container":
|
case "Container":
|
||||||
update(node.firstChild, currE._1, nextE._1)
|
update(node.firstChild, currE._1, nextE._1);
|
||||||
setPos(nextE._0, nextE._1.props.width, nextE._1.props.height, node.firstChild);
|
setPos(nextE._0, nextE._1.props.width, nextE._1.props.height, node.firstChild);
|
||||||
break;
|
break;
|
||||||
case "Custom":
|
case "Custom":
|
||||||
|
|
Loading…
Reference in a new issue