3 Commits

3 changed files with 17 additions and 6 deletions

View File

@@ -18,24 +18,35 @@
var group = document.createElement("span"); var group = document.createElement("span");
group.className = "ot-recurrence-status"; group.className = "ot-recurrence-status";
var radios = [];
for (var i = 0; i < select.options.length; i++) { for (var i = 0; i < select.options.length; i++) {
var opt = select.options[i]; var opt = select.options[i];
var label = document.createElement("label"); var label = document.createElement("label");
// Kanboard styles form labels as display:block; force inline so Yes/No sit
// side by side instead of stacked.
label.style.display = "inline-block";
label.style.marginRight = "14px"; label.style.marginRight = "14px";
label.style.cursor = "pointer"; label.style.cursor = "pointer";
var radio = document.createElement("input"); var radio = document.createElement("input");
radio.type = "radio"; 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.value = opt.value;
radio.checked = opt.value === select.value; radio.checked = opt.value === select.value;
radio.style.marginRight = "4px"; radio.style.marginRight = "4px";
radios.push(radio);
radio.addEventListener("change", function () { radio.addEventListener("change", function () {
if (this.checked) { for (var k = 0; k < radios.length; k++) {
select.value = this.value; radios[k].checked = (radios[k] === this);
select.dispatchEvent(new Event("change", { bubbles: true }));
} }
select.value = this.value;
select.dispatchEvent(new Event("change", { bubbles: true }));
}); });
label.appendChild(radio); label.appendChild(radio);

View File

@@ -76,7 +76,7 @@ class Plugin extends Base
public function getPluginVersion() public function getPluginVersion()
{ {
return '1.3.0'; return '1.3.2';
} }
public function getPluginHomepage() public function getPluginHomepage()

View File

@@ -1 +1 @@
OrganonTweaks v1.3.0 OrganonTweaks v1.3.2