summaryrefslogtreecommitdiffstats
path: root/web/widget/table/row.js
blob: 717b4dac480dd9dacfdeb6d0fc434fc7859c3a85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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, description) {
	    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;
	}
    });
});