From 1ef5f949530ef6fdab31746f316a2dd7033d234b Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 27 Sep 2013 08:06:32 +0100 Subject: [PATCH] Add draggable, ondrag and ondragend to new LI's --- lib/ice-coder.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 9df4a10..9de46ee 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -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) {