1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Trigger node - reset default timeout value when switcing away from wait for reset

This commit is contained in:
Dave Conway-Jones 2020-03-15 15:11:19 +00:00
parent b8e610e1b6
commit 43258ee816
No known key found for this signature in database
GPG Key ID: 302A6725C594817F

View File

@ -14,11 +14,11 @@
limitations under the License. limitations under the License.
--> -->
<script type="text/x-red" data-template-name="trigger"> <script type="text/html" data-template-name="trigger">
<div class="form-row"> <div class="form-row">
<label data-i18n="trigger.send" for="node-input-op1"></label> <label data-i18n="trigger.send" for="node-input-op1"></label>
<input type="hidden" id="node-input-op1type"> <input type="hidden" id="node-input-op1type">
<input style="width: 70%" type="text" id="node-input-op1" placeholder="1"> <input style="width:70%" type="text" id="node-input-op1" placeholder="1">
</div> </div>
<div class="form-row"> <div class="form-row">
<label data-i18n="trigger.then"></label> <label data-i18n="trigger.then"></label>
@ -40,12 +40,12 @@
</div> </div>
<div class="form-row node-type-wait"> <div class="form-row node-type-wait">
<label></label> <label></label>
<input type="checkbox" id="node-input-extend" style="margin-left: 0px; vertical-align: top; width: auto !important;"> <label style="width:auto !important;" for="node-input-extend" data-i18n="trigger.extend"></label> <input type="checkbox" id="node-input-extend" style="margin-left:0px; vertical-align:top; width:auto !important;"> <label style="width:auto !important;" for="node-input-extend" data-i18n="trigger.extend"></label>
</div> </div>
<div class="form-row node-type-wait"> <div class="form-row node-type-wait">
<label data-i18n="trigger.then-send"></label> <label data-i18n="trigger.then-send"></label>
<input type="hidden" id="node-input-op2type"> <input type="hidden" id="node-input-op2type">
<input style="width: 70%" type="text" id="node-input-op2" placeholder="0"> <input style="width:70%" type="text" id="node-input-op2" placeholder="0">
</div> </div>
<div class="form-row"> <div class="form-row">
<label data-i18n="trigger.label.reset" style="width:auto"></label> <label data-i18n="trigger.label.reset" style="width:auto"></label>
@ -109,9 +109,11 @@
$(".node-type-duration").hide(); $(".node-type-duration").hide();
} }
else if ($(this).val() == "loop") { else if ($(this).val() == "loop") {
if ($("#node-input-duration").val() == 0) { $("#node-input-duration").val(250); }
$(".node-type-wait").hide(); $(".node-type-wait").hide();
$(".node-type-duration").show(); $(".node-type-duration").show();
} else { } else {
if ($("#node-input-duration").val() == 0) { $("#node-input-duration").val(250); }
$(".node-type-wait").show(); $(".node-type-wait").show();
$(".node-type-duration").show(); $(".node-type-duration").show();
} }
@ -176,8 +178,6 @@
if ($("#node-then-type").val() == "loop") { if ($("#node-then-type").val() == "loop") {
$("#node-input-duration").val($("#node-input-duration").val() * -1); $("#node-input-duration").val($("#node-input-duration").val() * -1);
} }
} }
}); });
</script> </script>