diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2014-02-23 12:00:40 +0200 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2014-02-24 13:05:52 +0200 |
commit | 2088e9c1acda971e46b12ff4756a860225261f8e (patch) | |
tree | aa970ae74df63584ca890032616d2a8929f7ca89 | |
parent | 5c122667d3fa245d988fc9c90e3c5e8bfcb2bbf5 (diff) | |
download | aconf-2088e9c1acda971e46b12ff4756a860225261f8e.tar.bz2 aconf-2088e9c1acda971e46b12ff4756a860225261f8e.tar.xz |
web client: pass field description via element metadata
-rw-r--r-- | web/widget/abstract/base.js | 2 | ||||
-rw-r--r-- | web/widget/abstract/fields.js | 4 | ||||
-rw-r--r-- | web/widget/inline.js | 3 | ||||
-rw-r--r-- | web/widget/table/header.js | 2 | ||||
-rw-r--r-- | web/widget/table/row.js | 2 |
5 files changed, 7 insertions, 6 deletions
diff --git a/web/widget/abstract/base.js b/web/widget/abstract/base.js index d4ed661..cd78ffd 100644 --- a/web/widget/abstract/base.js +++ b/web/widget/abstract/base.js @@ -50,6 +50,8 @@ define(["acf2/dom", "jquery", "underscore"], function(dom, $, _) { this.wrapped.append(link); } + this.wrapped.data("description", meta.description); + this.handleResponse(this.requestData(value, meta)); var self = this; diff --git a/web/widget/abstract/fields.js b/web/widget/abstract/fields.js index 1a442e5..3f6b7bc 100644 --- a/web/widget/abstract/fields.js +++ b/web/widget/abstract/fields.js @@ -79,9 +79,7 @@ define( editable, removable ); - var container = this.appendWidget( - widget, label, meta.description - ); + var container = this.appendWidget(widget, label); widget.on("setVisible", function(event, visible) { if (visible) container.show(); else container.hide(); diff --git a/web/widget/inline.js b/web/widget/inline.js index 08ac14c..ee6332a 100644 --- a/web/widget/inline.js +++ b/web/widget/inline.js @@ -87,8 +87,9 @@ define( this.div.append(dom.button(label, action)); }, - appendWidget: function(el, label, description) { + appendWidget: function(el, label) { var self = this; + var description = el.data("description"); el = dom.makeRow(el); if (el.is("tr")) { diff --git a/web/widget/table/header.js b/web/widget/table/header.js index a5770c0..7c2f760 100644 --- a/web/widget/table/header.js +++ b/web/widget/table/header.js @@ -25,7 +25,7 @@ define(["acf2/widget/table/row", "jquery"], function(Base, $) { return table; }, - appendWidget: function(el, label, description) { + appendWidget: function(el, label) { el = Base.appendWidget.call(this, el, label); if (el) this.header.append($("<th>").text(label)); return el; diff --git a/web/widget/table/row.js b/web/widget/table/row.js index 69c116e..7e617b2 100644 --- a/web/widget/table/row.js +++ b/web/widget/table/row.js @@ -22,7 +22,7 @@ define( ); }, - appendWidget: function(el, label, description) { + appendWidget: function(el, label) { if (!el.is("td")) return null; if (this.prevWidget) this.prevWidget.after(el); else { |