Add draggable, ondrag and ondragend to new LI's

This commit is contained in:
Matt Pass
2013-09-27 08:06:32 +01:00
parent 9fbf1e7504
commit 1ef5f94953

View File

@@ -963,6 +963,9 @@ var ICEcoder = {
// Now we can add the first LI for this file/folder we're adding
newLI = document.createElement("li");
newLI.className = cssStyle;
newLI.draggable = true;
newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);top.ICEcoder.getcMInstance().focus()};
newLI.ondragend = function() {top.ICEcoder.dropFile(this)};
newLI.innerHTML = innerLI
locNest.nextSibling.appendChild(newLI);
locNest.nextSibling.appendChild(newText);
@@ -981,6 +984,9 @@ var ICEcoder = {
if ((elemType==actionElemType && nameLI > file) || (actionElemType=="folder" && elemType=="file") || i==locNest.childNodes.length-1) {
newLI = document.createElement("li");
newLI.className = cssStyle;
newLI.draggable = true;
newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);top.ICEcoder.getcMInstance().focus()};
newLI.ondragend = function() {top.ICEcoder.dropFile(this)};
newLI.innerHTML = innerLI;
// Append or insert depending on which of the above if statements is true
if (i==locNest.childNodes.length-1) {