From f9d87d59a158fcb1326e647b2ec40c4436125765 Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Tue, 15 Oct 2013 22:28:16 +0300 Subject: read-only fields --- web/client.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'web/client.js') diff --git a/web/client.js b/web/client.js index 0db3082..dfc8df6 100644 --- a/web/client.js +++ b/web/client.js @@ -417,7 +417,7 @@ $(function() { var value = data.get(name); var status = data.status(name); - if (!editable) { + if (!editable || meta.editable == false) { var el = this.staticRender(value); this.setElStatus(el, status); return el; @@ -461,7 +461,7 @@ $(function() { wrap: function() { return this.el; }, setStatus: function(status) { - this.setElStatus(this.el, status); + if (this.el) this.setElStatus(this.el, status); } } @@ -475,7 +475,7 @@ $(function() { data, name, meta, level, editable, removable ); - if (editable) { + if (editable && meta.editable) { var self = this; function change() { @@ -518,7 +518,7 @@ $(function() { }; Field.staticRender = function(value) { - return $("
").text(value); + return $("").text(value); }; Field.makeEl = function() { @@ -569,7 +569,7 @@ $(function() { var CheckBox = Object.create(Field); CheckBox.staticRender = function(value) { - return $("
").text(value ? "Yes" : "No"); + return $("").text(value ? "Yes" : "No"); }; CheckBox.setElStatus = function(el, status) { @@ -1029,7 +1029,7 @@ $(function() { status: function(name) { return null; } }, name, - null, + {}, 0, true, false -- cgit v1.2.3