Skip to content

Commit

Permalink
'editableOption's are now full width. 'editableOptionShort' type adde…
Browse files Browse the repository at this point in the history
…d to replace the old style.
  • Loading branch information
n1474335 committed Dec 26, 2018
1 parent e693240 commit 5acee80
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/Ingredient.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class Ingredient {
case "binaryString":
case "binaryShortString":
case "editableOption":
case "editableOptionShort":
return Utils.parseEscapedChars(data);
case "byteArray":
if (typeof data == "string") {
Expand Down
4 changes: 2 additions & 2 deletions src/core/operations/Split.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ class Split extends Operation {
this.args = [
{
"name": "Split delimiter",
"type": "editableOption",
"type": "editableOptionShort",
"value": SPLIT_DELIM_OPTIONS
},
{
"name": "Join delimiter",
"type": "editableOption",
"type": "editableOptionShort",
"value": JOIN_DELIM_OPTIONS
}
];
Expand Down
29 changes: 29 additions & 0 deletions src/web/HTMLIngredient.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,35 @@ class HTMLIngredient {
this.manager.addDynamicListener("#" + this.id, "change", this.populateOptionChange, this);
break;
case "editableOption":
html += `<div class="form-group input-group">
<label for="${this.id}" class="bmd-label-floating">${this.name}</label>
<input type="text"
class="form-control arg"
id="${this.id}"
arg-name="${this.name}"
value="${this.value[this.defaultIndex].value}"
${this.disabled ? "disabled" : ""}>
${this.hint ? "<span class='bmd-help'>" + this.hint + "</span>" : ""}
<div class="input-group-append">
<button type="button"
class="btn btn-secondary dropdown-toggle dropdown-toggle-split"
data-toggle="dropdown"
data-boundary="scrollParent"
aria-haspopup="true"
aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu editable-option-menu">`;
for (i = 0; i < this.value.length; i++) {
html += `<a class="dropdown-item" href="#" value="${this.value[i].value}">${this.value[i].name}</a>`;
}
html += `</div>
</div>
</div>`;

this.manager.addDynamicListener(".editable-option-menu a", "click", this.editableOptionClick, this);
break;
case "editableOptionShort":
html += `<div class="form-group input-group inline">
<label for="${this.id}" class="bmd-label-floating inline">${this.name}</label>
<input type="text"
Expand Down

0 comments on commit 5acee80

Please sign in to comment.