|
47 | 47 | initThings(this.connection, this.thing); |
48 | 48 | initProperties(this.connection, this.thing, this.property, outs); |
49 | 49 | } |
50 | | - $("select#node-input-connection").change(() => { |
| 50 | + $("select#node-input-connection").change((e) => { |
51 | 51 | const connection = $("#node-input-connection").val(); |
| 52 | + const thing_id = $("#node-input-thing").val(); |
52 | 53 | $("select#node-input-thing").empty(); |
53 | 54 | $("select#node-input-property").empty(); |
54 | 55 | if(connection === "_ADD_") { |
55 | | - $("<option value='" + "" + "'> " + "Select a connection" + "</option>").appendTo("#node-input-thing"); |
| 56 | + $("<option value='" + "" + "'> " + "No connection selected" + "</option>").appendTo("#node-input-thing"); |
56 | 57 | if(this.defaultname){ |
57 | 58 | $("#node-input-name").val(""); |
58 | 59 | } |
59 | 60 | } |
60 | | - if (this.connection !== connection && connection !== "_ADD_") { |
| 61 | + if ((this.connection !== connection && connection !== "_ADD_") || thing_id === "") { |
61 | 62 | initThings(connection); |
62 | 63 | } |
63 | 64 | $("#node-input-thing").trigger("change"); |
|
70 | 71 | initProperties(connection, thing_id, undefined, outs); |
71 | 72 | } else if (connection === "_ADD_") { |
72 | 73 | $("select#node-input-property").empty(); |
73 | | - $("<option value='" + "" + "'> " + "Select a connection" + "</option>").appendTo("#node-input-property"); |
| 74 | + $("<option value='" + "" + "'> " + "No connection selected" + "</option>").appendTo("#node-input-property"); |
74 | 75 | } else { |
75 | 76 | $("select#node-input-property").empty(); |
76 | | - $("<option value='" + "" + "'> " + "Select a thing" + "</option>").appendTo("#node-input-property"); |
| 77 | + $("<option value='" + "" + "'> " + "No thing selected" + "</option>").appendTo("#node-input-property"); |
77 | 78 | } |
78 | 79 | $("#node-input-property").trigger("change"); |
79 | 80 | }); |
80 | 81 | $("#node-input-property").change(() => { |
81 | | - debugger; |
82 | 82 | const property_name = $("#node-input-property").find('option:selected').text(); |
83 | 83 | const property_value = $("#node-input-property").find('option:selected').val(); |
84 | 84 | if (property_name !== "" && property_value !== "" && property_value !== undefined && this.defaultname) { |
|
0 commit comments