on master help sign in
Remove DOM update code in favor of naive update mechanism (replace everything). Not ideal, but should be added back when Element model is more robust.
commitfc6bcf69342d8222c1fa3267a3dc6af3ac937697 authorevancz <info@elm-lang.org> dateMon 30 Apr 2012, 21:55 (15 years ago) parentcdd1a89
1 file changed+1−29
core-js/runtime/Dispatcher.js+1−29
core-js/runtime/Dispatcher.js+1−29
@@ -54,34 +54,6 @@ var Elm = function() {
5454
5555var Dispatcher = function() {
5656 var program = null;
57− var update = function(context, newNode, oldNode) {
58− if (oldNode.style && newNode.style) {
59− oldNode.style.width = newNode.style.width;
60− oldNode.style.height = newNode.style.height;
61− }
62− if (newNode.hasOwnProperty('isElmLeaf') &&
63− oldNode.hasOwnProperty('isElmLeaf')) {
64− newNode.id = oldNode.id;
65− if (!newNode.isEqualNode(oldNode)) {
66− context.replaceChild(newNode, oldNode);
67− }
68− return;
69− }
70− if (newNode.nodeName === "CANVAS") {
71− context.replaceChild(newNode, oldNode);
72− return;
73− }
74− var nlist = newNode.childNodes;
75− var olist = oldNode.childNodes;
76− if (nlist.length !== olist.length) {
77− context.replaceChild(newNode, oldNode);
78− return;
79− }
80− for (var i = nlist.length; i--; ) {
81− update(oldNode, nlist[i], olist[i]);
82− }
83− };
84−
8557 var correctSize = function(e) {
8658 var kids = e.childNodes;
8759 var len = kids.length;
@@ -142,7 +114,7 @@ var Dispatcher = function() {
142114 var notify = function(id, v) {
143115 if (program.step(id,v)) {
144116 var content = document.getElementById('content');
145− update(content, program.value, content.children[0]);
117+ content.replaceChild(program.value, content.children[0]);
146118 correctSize(content);
147119 }
148120 };