# HG changeset patch # User ymh # Date 1364237359 -3600 # Node ID c04232f8cc53abfe6558468f8fa339367afb6171 # Parent daa99448319d58bce0c4fef6665c7f1092b25d77 First implementation of status change. diff -r daa99448319d -r c04232f8cc53 server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html --- a/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html Mon Mar 25 19:27:26 2013 +0100 +++ b/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html Mon Mar 25 19:49:19 2013 +0100 @@ -36,6 +36,7 @@ $(function() { var renkan_config = { static_url : /*[[@{/static/}]]*/ "", + read_only: true, bins: [ { type: "Wikipedia", @@ -90,8 +91,6 @@ require({corenkanConfig: corenkanConfig}, ["corenkan"], function(corenkan) { corenkan.app.onStatusChange = function(status) { - if(status == "ready") { - } }; }); }); diff -r daa99448319d -r c04232f8cc53 server/src/main/webapp/static/js/corenkan.js --- a/server/src/main/webapp/static/js/corenkan.js Mon Mar 25 19:27:26 2013 +0100 +++ b/server/src/main/webapp/static/js/corenkan.js Mon Mar 25 19:49:19 2013 +0100 @@ -39,6 +39,7 @@ sess.onStatusChange = function(status) { console.log(status); + that.onInternalStatusChange(status); if(typeof that.onStatusChange === "function") { that.onStatusChange(status); } @@ -117,6 +118,17 @@ this.project.set(obj, {validate: true}); }; + proto.onInternalStatusChange = function(status) { + if(status == "ready") { + this.renkan.read_only = false; + this.renkan.onStatusChange(); + } + else { + this.renkan.read_only = true; + this.renkan.onStatusChange(); + } + }; + function prepareValues(obj,c) { values = {}; for(var fieldname in c.changes) {