Skip to content

Commit

Permalink
fixed typos in tree handling JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Guite committed Mar 27, 2017
1 parent 65339e9 commit 1cfee01
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -103,7 +103,7 @@ class TreeFunctions {
tree.on('move_node.jstree', function (e, data) {
var node = data.node;
var parentId = data.parent;
var parentNode = $tree.jstree('get_node', parentId, false);
var parentNode = tree.jstree('get_node', parentId, false);

«vendorAndName»TreeSave(node, parentNode, 'bottom');
});
Expand Down Expand Up @@ -242,7 +242,7 @@ class TreeFunctions {
icon: 'fa fa-fw fa-angle-down',
separator_before: currentNode.is(':first-child')
};
actions.moveDown = {
actions.moveBottom = {
label: Translator.__('Move to bottom'),
title: Translator.__('Move to bottom position'),
action: function (node) {
Expand Down Expand Up @@ -279,13 +279,13 @@ class TreeFunctions {
params[op === 'addChildNode' ? 'pid' : 'id'] = nodeEntityId;

if (op === 'moveNodeTop') {
params[direction] = 'top';
params['direction'] = 'top';
} else if (op === 'moveNodeUp') {
params[direction] = 'up';
params['direction'] = 'up';
} else if (op === 'moveNodeDown') {
params[direction] = 'down';
params['direction'] = 'down';
} else if (op === 'moveNodeBottom') {
params[direction] = 'bottom';
params['direction'] = 'bottom';
}
}

Expand Down Expand Up @@ -328,14 +328,14 @@ class TreeFunctions {
var nodeParts, rootId, nodeId, destId;

// do not allow inserts on root level
if (node.parents.find('li').length < 1) {
if (node.parents.length < 1) {
return false;
}

nodeParts = node.attr('id').split('node_');
nodeParts = node.id.split('node_');
rootId = nodeParts[0].replace('tree', '');
nodeId = nodeParts[1];
destId = parentNode.attr('id').replace('tree' + rootId + 'node_', '');
destId = parentNode.id.replace('tree' + rootId + 'node_', '');

jQuery.ajax({
type: 'POST',
Expand Down

0 comments on commit 1cfee01

Please sign in to comment.