server/src/main/webapp/static/js/corenkan.js
changeset 80 5295e118320b
parent 54 43c35d6ca3f0
child 92 1723936b3836
equal deleted inserted replaced
79:f33771f3c510 80:5295e118320b
   102     
   102     
   103     proto.onStateResponse = function(state) {
   103     proto.onStateResponse = function(state) {
   104     	obj = json.parse(state);
   104     	obj = json.parse(state);
   105     	console.log("State response", obj);
   105     	console.log("State response", obj);
   106     	obj['_id'] = obj['id'];
   106     	obj['_id'] = obj['id'];
   107     	this.project.set(obj, {silent: true});    	
   107     	this.project.set(obj);
   108     };
   108     };
   109     
   109     
   110     function prepareValues(obj,c) {
   110     function prepareValues(obj,c) {
   111 		values = {};
   111 		values = {};
   112 		for(var fieldname in c.changes) {
   112 		for(var fieldname in c.changes) {
   295 	    		var field = projectFields[fi];
   295 	    		var field = projectFields[fi];
   296 	        	project.bind("change:"+field, function(obj, c) {
   296 	        	project.bind("change:"+field, function(obj, c) {
   297 	        		console.log(c);
   297 	        		console.log(c);
   298 	        		values = {
   298 	        		values = {
   299 	        		    id: obj.id,
   299 	        		    id: obj.id,
   300 	        		    type: "project",
   300 	        		    _type: "project",
   301 	        		    project_id: obj.id
   301 	        		    _project_id: obj.id,
       
   302 	        		    _user_id : (this.project.current_user!=null)?this.project.current_user.id:null
   302 	        		};
   303 	        		};
   303 	        		values[field] = c;
   304 	        		values[field] = c;
   304 	        		that.collab.sendSync("project", values);
   305 	        		that.collab.sendSync("project", values);
   305 	        	});
   306 	        	});
   306     		})(fieldIndex);
   307     		})(fieldIndex);