From cd86b6520c8d3058a31ce18a0b0eb29d8432c7c8 Mon Sep 17 00:00:00 2001 From: Vidar Hokstad Date: Tue, 9 Jun 2009 22:39:58 +0000 Subject: [PATCH] Sending state now works. Still some bugs in handling the state updates git-svn-id: http://svg-edit.googlecode.com/svn/trunk@82 eee81c28-f429-11dd-99c0-75d572ba1ddd --- wave/svg-edit.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wave/svg-edit.xml b/wave/svg-edit.xml index ac685fa2..1404d7e7 100644 --- a/wave/svg-edit.xml +++ b/wave/svg-edit.xml @@ -138,8 +138,10 @@ function stateUpdated() { var state = wave.getState(); var keys = state.getKeys(); - document.canvas.each(function(e) { - if (e) { + canvas.each(function(e) { +//alert(e); + var v = state.get(e.nodeId); + if (v) { var ob; var v = state.get(e.nodeId); eval("ob="+v); // FIXME: Yes, I'm using eval... Dirty, dirty.. @@ -157,14 +159,14 @@ // New nodes for (var k in keys) { var ob; - var v = state.get(e.nodeId); + var v = state.get(k); eval("ob="+v); // FIXME: Yes, I'm using eval... Dirty, dirty.. if (ob) canvas.updateElementFromJson(data) } } function sendDelta(canvas, elem) { - if (wave) return; + if (!wave) return; var delta = {}; var attrs = {}; var a = elem.attributes;