diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2013-10-15 22:28:16 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2013-10-15 22:28:16 +0300 |
commit | f9d87d59a158fcb1326e647b2ec40c4436125765 (patch) | |
tree | 67312d2239566e066996d8ae3245f3c7e8ee06df /web/client.js | |
parent | 7021795e1f73b7e66ffefe7956cf59290c6cdf05 (diff) | |
download | aconf-f9d87d59a158fcb1326e647b2ec40c4436125765.tar.bz2 aconf-f9d87d59a158fcb1326e647b2ec40c4436125765.tar.xz |
read-only fields
Diffstat (limited to 'web/client.js')
-rw-r--r-- | web/client.js | 12 |
1 files changed, 6 insertions, 6 deletions
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 $("<div>").text(value); + return $("<td>").text(value); }; Field.makeEl = function() { @@ -569,7 +569,7 @@ $(function() { var CheckBox = Object.create(Field); CheckBox.staticRender = function(value) { - return $("<div>").text(value ? "Yes" : "No"); + return $("<td>").text(value ? "Yes" : "No"); }; CheckBox.setElStatus = function(el, status) { @@ -1029,7 +1029,7 @@ $(function() { status: function(name) { return null; } }, name, - null, + {}, 0, true, false |