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
master
Vidar Hokstad 2009-06-09 22:39:58 +00:00
parent 6fda1f7d99
commit cd86b6520c
1 changed files with 6 additions and 4 deletions

View File

@ -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;