Skip to content

Commit

Permalink
fix default params issue
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Gupta <varun.gupta1798@gmail.com>
  • Loading branch information
tech4GT committed Oct 5, 2018
1 parent 2e7e042 commit 435239f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions examples/lib/defaultHtmlStepUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ function DefaultHtmlStepUi(_sequencer, options) {
}
html += "</select>";
} else {
let paramVal = step.options[paramName] || inputDesc.default;
html =
'<input class="form-control target" type="' +
inputDesc.type +
'" name="' +
paramName +
'" value="' +
inputDesc.default +
paramVal +
'" placeholder ="' +
(inputDesc.placeholder || "") +
'">';
Expand All @@ -96,8 +97,8 @@ function DefaultHtmlStepUi(_sequencer, options) {
step.ui.querySelector("div.details").appendChild(div);
}

function toggleSaveButton(){
$(step.ui.querySelector("div.details .btn-save")).prop("disabled",false);
function toggleSaveButton() {
$(step.ui.querySelector("div.details .btn-save")).prop("disabled", false);
}

$(step.ui.querySelector(".target")).change(toggleSaveButton);
Expand All @@ -117,7 +118,7 @@ function DefaultHtmlStepUi(_sequencer, options) {
// modify the url hash
setUrlHashParameter("steps", _sequencer.toString());
// disable the save button
$(step.ui.querySelector("div.details .btn-save")).prop("disabled",true);
$(step.ui.querySelector("div.details .btn-save")).prop("disabled", true);
}

// on clicking Save in the details pane of the step
Expand Down Expand Up @@ -160,13 +161,13 @@ function DefaultHtmlStepUi(_sequencer, options) {
var outputs = _sequencer.modulesInfo(step.name).outputs;
for (var i in inputs) {
if (step.options[i] !== undefined) {
if (inputs[i].type.toLowerCase() === "input")
step.ui.querySelector('div[name="' + i + '"] input').value =
step.options[i];
if (inputs[i].type.toLowerCase() === "select")
step.ui.querySelector('div[name="' + i + '"] select').value =
step.options[i];
}
if (inputs[i].type.toLowerCase() === "input")
step.ui.querySelector('div[name="' + i + '"] input').value =
step.options[i];
if (inputs[i].type.toLowerCase() === "select")
step.ui.querySelector('div[name="' + i + '"] select').value =
step.options[i];
}
}
for (var i in outputs) {
if (step[i] !== undefined)
Expand Down

0 comments on commit 435239f

Please sign in to comment.