mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
fixed bug with outputs not being set correctly after initial load
This commit is contained in:
parent
497f08bba9
commit
e72ced85e6
@ -111,34 +111,36 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('postgres',{
|
RED.nodes.registerType('postgres',{
|
||||||
category: 'storage-output',
|
category: 'storage-output',
|
||||||
color:"rgb(148, 226, 252)",
|
color:"rgb(148, 226, 252)",
|
||||||
defaults: {
|
defaults: {
|
||||||
postgresdb: { type:"postgresdb",required:true},
|
postgresdb: { type:"postgresdb",required:true},
|
||||||
name: {value:""},
|
name: {value:""},
|
||||||
output: {value:false}
|
output: {value:false},
|
||||||
},
|
outputs: {value:0}
|
||||||
inputs:1,
|
},
|
||||||
outputs:0,
|
inputs: 1,
|
||||||
icon: "postgres.png",
|
outputs: 0,
|
||||||
align: "right",
|
icon: "postgres.png",
|
||||||
label: function() {
|
align: "right",
|
||||||
return this.name||(this.sqlquery?this.sqlquery:"postgres");
|
label: function() {
|
||||||
},
|
return this.name||(this.sqlquery?this.sqlquery:"postgres");
|
||||||
labelStyle: function() {
|
},
|
||||||
return this.name?"node_label_italic":"";
|
labelStyle: function() {
|
||||||
},
|
return this.name?"node_label_italic":"";
|
||||||
oneditprepare: function() {
|
},
|
||||||
|
oneditprepare: function() {
|
||||||
$( "#node-input-output" ).prop( "checked", this.output );
|
|
||||||
$("#node-input-name").focus();
|
$( "#node-input-output" ).prop( "checked", this.output );
|
||||||
|
$("#node-input-name").focus();
|
||||||
},
|
|
||||||
oneditsave: function() {
|
},
|
||||||
|
oneditsave: function() {
|
||||||
|
|
||||||
var hasOutput = $( "#node-input-output" ).prop( "checked" );
|
var hasOutput = $( "#node-input-output" ).prop( "checked" );
|
||||||
this.outputs = hasOutput ? 1: 0;
|
this.outputs = hasOutput ? 1:0;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user