mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-12 03:10:03 +01:00
Disable-save-button (#322)
This commit is contained in:
@@ -60,14 +60,14 @@ function DefaultHtmlStepUi(_sequencer, options) {
|
|||||||
if (!isInput) {
|
if (!isInput) {
|
||||||
html += '<span class="output"></span>';
|
html += '<span class="output"></span>';
|
||||||
} else if (inputDesc.type.toLowerCase() == "select") {
|
} else if (inputDesc.type.toLowerCase() == "select") {
|
||||||
html += '<select class="form-control" name="' + paramName + '">';
|
html += '<select class="form-control target" name="' + paramName + '">';
|
||||||
for (var option in inputDesc.values) {
|
for (var option in inputDesc.values) {
|
||||||
html += "<option>" + inputDesc.values[option] + "</option>";
|
html += "<option>" + inputDesc.values[option] + "</option>";
|
||||||
}
|
}
|
||||||
html += "</select>";
|
html += "</select>";
|
||||||
} else {
|
} else {
|
||||||
html =
|
html =
|
||||||
'<input class="form-control" type="' +
|
'<input class="form-control target" type="' +
|
||||||
inputDesc.type +
|
inputDesc.type +
|
||||||
'" name="' +
|
'" name="' +
|
||||||
paramName +
|
paramName +
|
||||||
@@ -91,8 +91,15 @@ function DefaultHtmlStepUi(_sequencer, options) {
|
|||||||
</div>";
|
</div>";
|
||||||
step.ui.querySelector("div.details").appendChild(div);
|
step.ui.querySelector("div.details").appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleSaveButton(){
|
||||||
|
$(step.ui.querySelector("div.details .btn-save")).prop("disabled",false);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(step.ui.querySelector(".target")).change(toggleSaveButton);
|
||||||
|
|
||||||
$(step.ui.querySelector("div.details")).append(
|
$(step.ui.querySelector("div.details")).append(
|
||||||
"<p><button class='btn btn-default btn-save'>Save</button></p>"
|
"<p><button class='btn btn-default btn-save' disabled = 'true' >Save</button></p>"
|
||||||
);
|
);
|
||||||
|
|
||||||
function saveOptions() {
|
function saveOptions() {
|
||||||
@@ -105,6 +112,8 @@ function DefaultHtmlStepUi(_sequencer, options) {
|
|||||||
|
|
||||||
// modify the url hash
|
// modify the url hash
|
||||||
setUrlHashParameter("steps", _sequencer.toString());
|
setUrlHashParameter("steps", _sequencer.toString());
|
||||||
|
// disable the save button
|
||||||
|
$(step.ui.querySelector("div.details .btn-save")).prop("disabled",true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// on clicking Save in the details pane of the step
|
// on clicking Save in the details pane of the step
|
||||||
|
|||||||
Reference in New Issue
Block a user