summaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-11 08:57:23 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-11 08:57:23 -0700
commiteb7456089a99e95abb69389ab4b0b3a330aae05f (patch)
treeda7b99af51cc0a946e338c766f4ee0e5bb34e956 /ext/bg/js
parent5cc989b87f671702912e28c0bce3747b6b79b87b (diff)
Adding dropdown
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options-form.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 99d01db4..bb9f762b 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -118,10 +118,17 @@ function populateAnkiFields(element, opts) {
const body = $('<tbody>');
names.forEach((name) => {
+ const groupBtn = $('<div>', {class: 'input-group-btn'});
+ groupBtn.append($('<button>', {type: 'button', class: 'btn btn-default dropdown-toggle'}).append($('<span>', {class: 'caret'})));
+
+ const group = $('<div>', {class: 'input-group'});
+ group.append($('<input>', {class: 'anki-field-value form-control', value: opts[optKey][name] || ''}).data('field', name).change(onOptionsAnkiChanged));
+ group.append(groupBtn);
+
const row = $('<tr>');
row.append($('<td>', {class: 'col-sm-2'}).text(name));
- const value = opts[optKey][name] || '';
- row.append($('<td>', {class: 'col-sm-10'}).append($('<input>', {class: 'anki-field-value form-control', value}).data('field', name).change(onOptionsAnkiChanged)));
+ row.append($('<td>', {class: 'col-sm-10'}).append(group));
+
body.append(row);
});