pills: Use a template to render the pills.

This commit is contained in:
Steve Howell
2018-03-31 07:22:29 -04:00
committed by Tim Abbott
parent d48fb1d776
commit cd8c15f1cf
5 changed files with 54 additions and 7 deletions

View File

@@ -93,7 +93,13 @@ exports.create = function (opts) {
store.pills.push(payload);
payload.$element = $("<div class='pill' data-id='" + payload.id + "' tabindex=0>" + item.display_value + "<div class='exit'>&times;</div></div>");
var opts = {
id: payload.id,
display_value: item.display_value,
};
var pill_html = templates.render('input_pill', opts);
payload.$element = $(pill_html);
store.$input.before(payload.$element);
},