@dualbox/editor 1.0.50 → 1.0.52
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.
- package/js/dist/GraphEditor.js +258 -161
- package/js/dist/GraphEditor.min.js +257 -160
- package/js/src/GraphEditor.js +4 -0
- package/js/src/v/templates/addNode.vue +29 -14
- package/js/src/v/templates/main.vue +694 -599
- package/package.json +1 -1
package/js/src/GraphEditor.js
CHANGED
|
@@ -311,6 +311,13 @@ export default {
|
|
|
311
311
|
console.log('AddNode updated !');
|
|
312
312
|
this.updateVisibility();
|
|
313
313
|
this.setSearchFocus();
|
|
314
|
+
|
|
315
|
+
if( !this.display ) {
|
|
316
|
+
// make sure the modal disappeared
|
|
317
|
+
$(this.$el).modal('hide');
|
|
318
|
+
$('body').removeClass('modal-open');
|
|
319
|
+
$('.modal-backdrop').remove();
|
|
320
|
+
}
|
|
314
321
|
},
|
|
315
322
|
mounted: function() {
|
|
316
323
|
var self = this;
|
|
@@ -361,10 +368,12 @@ export default {
|
|
|
361
368
|
case "ui":
|
|
362
369
|
var selectedNode = $('.node-result.selected')[0];
|
|
363
370
|
if( selectedNode ) {
|
|
364
|
-
// add node to the controller
|
|
365
|
-
var packageName = $(selectedNode).data('package');
|
|
366
|
-
this.view.c.addNewBox(packageName, this.mousePosition);
|
|
367
371
|
this.closeModal();
|
|
372
|
+
this.$nextTick(() => {
|
|
373
|
+
// add node to the controller
|
|
374
|
+
var packageName = $(selectedNode).data('package');
|
|
375
|
+
this.view.c.addNewBox(packageName, this.mousePosition);
|
|
376
|
+
});
|
|
368
377
|
}
|
|
369
378
|
else {
|
|
370
379
|
swal('Please select a node', '', 'error');
|
|
@@ -377,12 +386,14 @@ export default {
|
|
|
377
386
|
var name = $(this.$el).find('.input-name').val();
|
|
378
387
|
var desc = $(this.$el).find('.input-description').val();
|
|
379
388
|
if( type !== undefined && name ) {
|
|
380
|
-
this.view.c.addInput(name, type, desc, this.mousePosition);
|
|
381
|
-
// reset fields
|
|
382
|
-
this.$refs.inputType.resetChanges();
|
|
383
|
-
$(this.$el).find('.input-name').val("");
|
|
384
|
-
$(this.$el).find('.input-description').val("");
|
|
385
389
|
this.closeModal();
|
|
390
|
+
this.$nextTick(() => {
|
|
391
|
+
this.view.c.addInput(name, type, desc, this.mousePosition);
|
|
392
|
+
// reset fields
|
|
393
|
+
this.$refs.inputType.resetChanges();
|
|
394
|
+
$(this.$el).find('.input-name').val("");
|
|
395
|
+
$(this.$el).find('.input-description').val("");
|
|
396
|
+
});
|
|
386
397
|
}
|
|
387
398
|
else {
|
|
388
399
|
swal('Please complete all fields', '', 'error');
|
|
@@ -395,12 +406,14 @@ export default {
|
|
|
395
406
|
var type = this.$refs.outputType.get();
|
|
396
407
|
var desc = $(this.$el).find('.output-description').val();
|
|
397
408
|
if( type !== undefined && name ) {
|
|
398
|
-
this.view.c.addOutput(name, type, desc, this.mousePosition);
|
|
399
|
-
// reset fields
|
|
400
|
-
this.$refs.outputType.resetChanges();
|
|
401
|
-
$(this.$el).find('.output-name').val("");
|
|
402
|
-
$(this.$el).find('.output-description').val("");
|
|
403
409
|
this.closeModal();
|
|
410
|
+
this.$nextTick(() => {
|
|
411
|
+
this.view.c.addOutput(name, type, desc, this.mousePosition);
|
|
412
|
+
// reset fields
|
|
413
|
+
this.$refs.outputType.resetChanges();
|
|
414
|
+
$(this.$el).find('.output-name').val("");
|
|
415
|
+
$(this.$el).find('.output-description').val("");
|
|
416
|
+
});
|
|
404
417
|
}
|
|
405
418
|
else {
|
|
406
419
|
swal('Please complete all fields', '', 'error');
|
|
@@ -419,8 +432,10 @@ export default {
|
|
|
419
432
|
var json = this.metanodeJSON || {};
|
|
420
433
|
json.description = desc;
|
|
421
434
|
|
|
422
|
-
this.view.c.addNewMetabox(name, json, this.mousePosition);
|
|
423
435
|
this.closeModal();
|
|
436
|
+
this.$nextTick(() => {
|
|
437
|
+
this.view.c.addNewMetabox(name, json, this.mousePosition);
|
|
438
|
+
});
|
|
424
439
|
default:
|
|
425
440
|
}
|
|
426
441
|
},
|