summaryrefslogtreecommitdiff
path: root/src/ws/view.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ws/view.js')
-rw-r--r--src/ws/view.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/ws/view.js b/src/ws/view.js
index 264ef9f..6c43dc8 100644
--- a/src/ws/view.js
+++ b/src/ws/view.js
@@ -83,7 +83,7 @@ function deleteNode(id)
function getElementAfter(e)
{
- if(e.target.className != "children")
+ if(!e.target.classList.contains("children"))
{
return null;
}
@@ -92,7 +92,7 @@ function getElementAfter(e)
var min_y_diff = 9999999999999;
for(var i = 0; i < e.target.childNodes.length; ++i)
{
- if(e.target.children[i].className != "node") // Only look at node elements
+ if(!e.target.children[i].classList.contains("node")) // Only look at node elements
{
continue;
}
@@ -121,7 +121,7 @@ var last_over = null;
function dragenter(e)
{
// Only highlight children areas
- if(e.target.className != "children")
+ if(!e.target.classList.contains("children"))
{
return;
}
@@ -133,7 +133,7 @@ var last_after = null;
function dragover(e)
{
// // Only highlight children areas
-// if(e.target.className != "children")
+// if(!e.target.classList.contains("children"))
// {
// return;
// }
@@ -155,7 +155,7 @@ function dragover(e)
function dragleave(e)
{
// Only highlight children areas
- if(e.target.className != "children")
+ if(!e.target.classList.contains("children"))
{
return;
}
@@ -172,7 +172,7 @@ function dragEnd(e)
update(idFromStr(id), "dragged", "false");
// // Only highlight children areas
-// if(e.target.className != "children")
+// if(!e.target.classList.contains("children"))
// {
// return;
// }
@@ -199,7 +199,7 @@ function drop(e)
e.stopPropagation();
// Only allow drops in children areas
- if(e.target.className != "children")
+ if(!e.target.classList.contains("children"))
{
return;
}
@@ -209,7 +209,6 @@ function drop(e)
// Get drop id from targets parent (children tag inside the node)
var dropid = e.target.parentElement.id;
- console.log("dropid: " + dropid);
// Prevent dropping on item itself
if(id == dropid)
{
@@ -338,10 +337,10 @@ function collapse(e)
e.stopPropagation();
if(collapsed)
{
- node.children_element.classList.add('collapsed');
+ node.element.classList.add('collapsed');
}
else
{
- node.children_element.classList.remove('collapsed');
+ node.element.classList.remove('collapsed');
}
}