Skip to content

Commit e72ced8

Browse files
committed
fixed bug with outputs not being set correctly after initial load
1 parent 497f08b commit e72ced8

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

storage/postgres/110-postgres.html

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -111,34 +111,36 @@
111111

112112
<script type="text/javascript">
113113
RED.nodes.registerType('postgres',{
114-
category: 'storage-output',
115-
color:"rgb(148, 226, 252)",
116-
defaults: {
117-
postgresdb: { type:"postgresdb",required:true},
118-
name: {value:""},
119-
output: {value:false}
120-
},
121-
inputs:1,
122-
outputs:0,
123-
icon: "postgres.png",
124-
align: "right",
125-
label: function() {
126-
return this.name||(this.sqlquery?this.sqlquery:"postgres");
127-
},
128-
labelStyle: function() {
129-
return this.name?"node_label_italic":"";
130-
},
131-
oneditprepare: function() {
132-
133-
$( "#node-input-output" ).prop( "checked", this.output );
134-
$("#node-input-name").focus();
135-
136-
},
137-
oneditsave: function() {
114+
category: 'storage-output',
115+
color:"rgb(148, 226, 252)",
116+
defaults: {
117+
postgresdb: { type:"postgresdb",required:true},
118+
name: {value:""},
119+
output: {value:false},
120+
outputs: {value:0}
121+
},
122+
inputs: 1,
123+
outputs: 0,
124+
icon: "postgres.png",
125+
align: "right",
126+
label: function() {
127+
return this.name||(this.sqlquery?this.sqlquery:"postgres");
128+
},
129+
labelStyle: function() {
130+
return this.name?"node_label_italic":"";
131+
},
132+
oneditprepare: function() {
133+
134+
$( "#node-input-output" ).prop( "checked", this.output );
135+
$("#node-input-name").focus();
136+
137+
},
138+
oneditsave: function() {
138139

139-
var hasOutput = $( "#node-input-output" ).prop( "checked" );
140-
this.outputs = hasOutput ? 1: 0;
141-
142-
}
143-
});
140+
var hasOutput = $( "#node-input-output" ).prop( "checked" );
141+
this.outputs = hasOutput ? 1:0;
142+
143+
}
144+
});
145+
144146
</script>

0 commit comments

Comments
 (0)