diff options
Diffstat (limited to 'web/widget/table/row.js')
-rw-r--r-- | web/widget/table/row.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/web/widget/table/row.js b/web/widget/table/row.js new file mode 100644 index 0000000..23aadc3 --- /dev/null +++ b/web/widget/table/row.js @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2012-2014 Kaarle Ritvanen + * See LICENSE file for license details + */ + +define(["acf2/widget/abstract/fields", "jquery"], function(Base, $) { + return Base.extend({ + createEl: function() { + this.previous = null; + return $("<tr>").html($("<td>").prop("class", "placeholder")); + }, + + showHeading: false, + + appendWidget: function(el, label) { + if (!el.is("td")) return null; + if (this.previous) this.previous.after(el); + else { + var ph = this.el.find(".placeholder"); + ph.after(el); + ph.remove(); + } + this.previous = el; + return el; + } + }); +}); |