Fixed boolean arg checkboxes

This commit is contained in:
n1474335 2018-06-17 13:49:32 +01:00
parent 4147ec719b
commit ab9bc7e390
3 changed files with 22 additions and 17 deletions

View File

@ -105,15 +105,15 @@ class HTMLIngredient {
case "boolean":
html += `<div class="form-group inline">
<div class="checkbox">
<label>
<input type="checkbox"
class="arg"
id="${this.id}"
arg-name="${this.name}"
${this.value ? " checked='checked' " : ""}
${this.disabled ? " disabled='disabled'" : ""}
value="${this.name}"> ${this.name}
</label>
<label>
<input type="checkbox"
class="arg"
id="${this.id}"
arg-name="${this.name}"
${this.value ? " checked" : ""}
${this.disabled ? " disabled" : ""}
value="${this.name}"> ${this.name}
</label>
</div>
</div>`;
break;
@ -243,6 +243,8 @@ class HTMLIngredient {
input = link.parentNode.parentNode.parentNode.querySelector("input");
input.value = link.getAttribute("value");
const evt = new Event("change");
input.dispatchEvent(evt);
this.manager.recipe.ingChange();
}

View File

@ -446,42 +446,42 @@
</select>
</div>
<div class="switch option-item">
<div class="checkbox option-item">
<label for="updateUrl">
<input type="checkbox" option="updateUrl" id="updateUrl" checked>
Update the URL when the input or recipe changes
</label>
</div>
<div class="switch option-item">
<div class="checkbox option-item">
<label for="showHighlighter">
<input type="checkbox" option="showHighlighter" id="showHighlighter" checked>
Highlight selected bytes in output and input (when possible)
</label>
</div>
<div class="switch option-item">
<div class="checkbox option-item">
<label for="treatAsUtf8">
<input type="checkbox" option="treatAsUtf8" id="treatAsUtf8" checked>
Treat output as UTF-8 if possible
</label>
</div>
<div class="switch option-item">
<div class="checkbox option-item">
<label for="wordWrap">
<input type="checkbox" option="wordWrap" id="wordWrap" checked>
Word wrap the input and output
</label>
</div>
<div class="switch option-item">
<div class="checkbox option-item">
<label for="showErrors">
<input type="checkbox" option="showErrors" id="showErrors" checked>
Operation error reporting (recommended)
</label>
</div>
<div class="switch option-item">
<div class="checkbox option-item">
<label for="useMetaKey">
<input type="checkbox" option="useMetaKey" id="useMetaKey">
Use meta key for keybindings (Windows ⊞/Command ⌘)

View File

@ -34,6 +34,7 @@
.operation input.form-control,
.operation select.form-control,
.operation textarea,
.operation .bmd-label-floating,
.operation .bmd-label-static {
padding-left: 5px;
@ -41,14 +42,16 @@
}
.operation [class^='bmd-label'],
.operation [class*=' bmd-label'] {
.operation [class*=' bmd-label'],
.operation label {
color: #388e3c;
}
.operation .is-focused [class^='bmd-label'],
.operation .is-focused [class*=' bmd-label'],
.operation .is-focused [class^='bmd-label'],
.operation .is-focused [class*=' bmd-label'] {
.operation .is-focused [class*=' bmd-label'],
.operation .is-focused label {
color: #1976d2;
}