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

Disable inject-now button if inside subflow

This commit is contained in:
Nick O'Leary 2021-06-08 10:56:34 +01:00
parent 9b46dbaff1
commit c8bcd2818d
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 8 additions and 3 deletions

View File

@ -488,12 +488,12 @@
/* */ /* */
var eList = $('#node-input-property-container').css('min-height','120px').css('min-width','450px'); var eList = $('#node-input-property-container').css('min-height','120px').css('min-width','450px');
eList.editableList({ eList.editableList({
buttons: [ buttons: [
{ {
id: "node-inject-test-inject-button", id: "node-inject-test-inject-button",
label: node._("inject.inject"), label: node._("inject.injectNow"),
icon: "fa fa-bolt",
click: function(e) { click: function(e) {
var items = eList.editableList('items'); var items = eList.editableList('items');
var result = getProps(items); var result = getProps(items);
@ -538,7 +538,11 @@
removable: true, removable: true,
sortable: true sortable: true
}); });
$('#node-inject-test-inject-button').addClass('primary').css("float", "right").css("margin-right", "unset"); $('#node-inject-test-inject-button').css("float", "right").css("margin-right", "unset");
if (RED.nodes.subflow(node.z)) {
$('#node-inject-test-inject-button').attr("disabled",true);
}
if (!node.props) { if (!node.props) {
var payload = { var payload = {

View File

@ -32,6 +32,7 @@
}, },
"inject": { "inject": {
"inject": "inject", "inject": "inject",
"injectNow": "inject now",
"repeat": "repeat = __repeat__", "repeat": "repeat = __repeat__",
"crontab": "crontab = __crontab__", "crontab": "crontab = __crontab__",
"stopped": "stopped", "stopped": "stopped",