node-red-contrib-mobius-flow-base 2.5.86-beta.60 → 2.5.86-beta.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,8 +20,29 @@ initMobsearch = {
20
20
  // opts.containerName
21
21
  // opts.containerSecondFieldName
22
22
 
23
+ let selectionIndex = 0;
24
+
25
+ function addSearchButton(field, i) {
26
+ field.click(function () {
27
+ selectionIndex = i;
28
+ $('#node-input-resources-container-row').hide();
29
+ $('#instance-search-sid').val('');
30
+ $('#instance-search-pid').val('');
31
+ $('#instance-search-ins').val('');
32
+ $('#instance-search-rid').val('');
33
+ $('#node-search-return').removeClass('disabled');
34
+ $('#node-search-accept').removeClass('disabled');
35
+ $('#instance-search-row').show();
36
+ });
37
+ }
38
+
23
39
  function getMobsearch(mobiusSrvc, useRid, listed, opts) {
24
- console.log($(`#${opts.uriFieldName}`).val());
40
+ selectionIndex = 0;
41
+
42
+ if (useRid) {
43
+ $(`#${opts.uriFieldName}`).val($(`#${opts.uriFieldName}`).val());
44
+ }
45
+
25
46
  //level dependent html
26
47
  let rows =
27
48
  useRid === true
@@ -249,7 +270,7 @@ function getMobsearch(mobiusSrvc, useRid, listed, opts) {
249
270
  uri = uri.substring(0, uri.indexOf('#') + 1);
250
271
  }
251
272
  if (listed) {
252
- opts.list[opts.selectionIndex].uri = uri;
273
+ opts.list[selectionIndex].uri = uri;
253
274
  updateList();
254
275
  } else {
255
276
  $(`#${opts.uriFieldName}`).val(uri);
@@ -87,7 +87,6 @@ POSSIBILITY OF SUCH DAMAGE.
87
87
  }
88
88
 
89
89
  let mobiusSrvc = $("#node-input-connection").val();
90
- let globalIndex = 0;
91
90
 
92
91
  /** Create the subs container and populate it */
93
92
  $('#node-input-resources-container').css('min-height', '300px').css('min-width', '450px').editableList ({
@@ -121,23 +120,10 @@ POSSIBILITY OF SUCH DAMAGE.
121
120
  // resizeResource(container);
122
121
 
123
122
  // *** MOBSEARCH *** //
124
-
125
123
  if (!node.resources[i]) {
126
124
  node.resources[i] = {uri: '', comment: ''}
127
125
  }
128
-
129
- searchField.click(function () {
130
- globalIndex = i;
131
- $('#node-input-resources-container-row').hide();
132
- $("#instance-search-sid").val('');
133
- $("#instance-search-pid").val('');
134
- $("#instance-search-ins").val('');
135
- $("#instance-search-rid").val('');
136
- $("#node-search-return").removeClass('disabled');
137
- $("#node-search-accept").removeClass('disabled');
138
- $("#instance-search-row").show();
139
-
140
- });
126
+ addSearchButton(searchField, i)
141
127
  // *** END MOBSEARCH *** //
142
128
  },
143
129
  resizeItem: resizeResource
@@ -152,7 +138,6 @@ POSSIBILITY OF SUCH DAMAGE.
152
138
 
153
139
  opts = {
154
140
  list: node.resources,
155
- selectionIndex: globalIndex,
156
141
  containerRowName: 'node-input-resources-container-row',
157
142
  containerName: 'node-input-resources-container',
158
143
  containerSecondFieldName: 'node-input-resources-comment',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-mobius-flow-base",
3
- "version": "2.5.86-beta.60",
3
+ "version": "2.5.86-beta.61",
4
4
  "description": "Node-RED base nodes for Mobius Flow",
5
5
  "main": "index.js",
6
6
  "types": "dist/index.d.ts",