|
@@ -198,21 +198,18 @@
|
|
"multiple": false,
|
|
"multiple": false,
|
|
"animation": 0
|
|
"animation": 0
|
|
},
|
|
},
|
|
- "dnd": {
|
|
|
|
- "use_html5": true
|
|
|
|
- },
|
|
|
|
"contextmenu": {
|
|
"contextmenu": {
|
|
show_at_node: false,
|
|
show_at_node: false,
|
|
items: function ($node) {
|
|
items: function ($node) {
|
|
return {
|
|
return {
|
|
- /*"cols": {
|
|
|
|
- "label": "<span class='text-sm'>Report Columns</span>",
|
|
|
|
|
|
+ "data": {
|
|
|
|
+ "label": "<span class='text-sm'>View Data</span>",
|
|
"action": function (obj) {
|
|
"action": function (obj) {
|
|
|
|
|
|
},
|
|
},
|
|
- },*/
|
|
|
|
|
|
+ },
|
|
"remove": {
|
|
"remove": {
|
|
- "label": "<span class='text-sm'>Remove</span>",
|
|
|
|
|
|
+ "label": "<span class='text-sm'>Remove Node</span>",
|
|
"action": function (obj) {
|
|
"action": function (obj) {
|
|
let id = $(obj.reference).find('>div.stat-tree-line').attr('data-line-id');
|
|
let id = $(obj.reference).find('>div.stat-tree-line').attr('data-line-id');
|
|
$('.remove-line-moe-' + id).find('a[start]').trigger('click');
|
|
$('.remove-line-moe-' + id).find('a[start]').trigger('click');
|
|
@@ -238,24 +235,36 @@
|
|
"animation": 0
|
|
"animation": 0
|
|
},
|
|
},
|
|
"dnd": {
|
|
"dnd": {
|
|
- "use_html5": true
|
|
|
|
|
|
+ "is_draggable": function(_node, _e) {
|
|
|
|
+ return $('#' + _node[0].id).find('>a.jstree-anchor>.clause').length === 1;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
"contextmenu": {
|
|
"contextmenu": {
|
|
show_at_node: false,
|
|
show_at_node: false,
|
|
items: function ($node) {
|
|
items: function ($node) {
|
|
- return {
|
|
|
|
- "edit": {
|
|
|
|
- "label": "<span class='text-sm'>Edit</span>",
|
|
|
|
- "action": function (obj) {
|
|
|
|
- let id = $(obj.reference).find('>div.clause').attr('data-clause-id');
|
|
|
|
- $('.edit-clause-moe-' + id).find('a[start]').trigger('click');
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "remove": {
|
|
|
|
- "label": "<span class='text-sm'>Remove</span>",
|
|
|
|
- "action": function (obj) {
|
|
|
|
- let id = $(obj.reference).find('>div.clause').attr('data-clause-id');
|
|
|
|
- $('.remove-clause-moe-' + id).find('a[start]').trigger('click');
|
|
|
|
|
|
+ console.log($node);
|
|
|
|
+ if($('#' + $node.id).find('>a.jstree-anchor>.clause').length === 1) { // clause
|
|
|
|
+ return {
|
|
|
|
+ "edit": {
|
|
|
|
+ "label": "<span class='text-sm'>Edit Clause</span>",
|
|
|
|
+ "action": function (obj) {
|
|
|
|
+ let id = $(obj.reference).find('>div.clause').attr('data-clause-id');
|
|
|
|
+ $('.edit-clause-moe-' + id).find('a[start]').trigger('click');
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "remove": {
|
|
|
|
+ "label": "<span class='text-sm'>Remove Clause</span>",
|
|
|
|
+ "action": function (obj) {
|
|
|
|
+ let id = $(obj.reference).find('>div.clause').attr('data-clause-id');
|
|
|
|
+ $('.remove-clause-moe-' + id).find('a[start]').trigger('click');
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "add_arg": {
|
|
|
|
+ "label": "<span class='text-sm'>Add Clause Arg</span>",
|
|
|
|
+ "action": function (obj) {
|
|
|
|
+ let id = $(obj.reference).find('>div.clause').attr('data-clause-id');
|
|
|
|
+ $('.add-clause-arg-moe-' + id).find('a[start]').trigger('click');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|