enhance-recurrence radio button only on display bugfix v1.3.2
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
var group = document.createElement("span");
|
||||
group.className = "ot-recurrence-status";
|
||||
|
||||
var radios = [];
|
||||
|
||||
for (var i = 0; i < select.options.length; i++) {
|
||||
var opt = select.options[i];
|
||||
|
||||
@@ -30,15 +32,21 @@
|
||||
|
||||
var radio = document.createElement("input");
|
||||
radio.type = "radio";
|
||||
radio.name = "ot-recurrence-status";
|
||||
// No name attribute on purpose: a named radio would be SUBMITTED with the form,
|
||||
// and Kanboard rejects the extra key ("invalid identifier"). These are display
|
||||
// only -- the hidden <select> carries the value -- so we enforce the mutual
|
||||
// exclusivity ourselves.
|
||||
radio.value = opt.value;
|
||||
radio.checked = opt.value === select.value;
|
||||
radio.style.marginRight = "4px";
|
||||
radios.push(radio);
|
||||
|
||||
radio.addEventListener("change", function () {
|
||||
if (this.checked) {
|
||||
select.value = this.value;
|
||||
select.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
for (var k = 0; k < radios.length; k++) {
|
||||
radios[k].checked = (radios[k] === this);
|
||||
}
|
||||
select.value = this.value;
|
||||
select.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
});
|
||||
|
||||
label.appendChild(radio);
|
||||
|
||||
Reference in New Issue
Block a user