From 9197d24fff5e7ccfa5fe09802124251fe1c36d75 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Tue, 19 Mar 2013 17:11:37 +0000 Subject: [PATCH] Check for file/folder at location before adding --- lib/ice-coder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 1145444..6209b6d 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -713,7 +713,7 @@ var ICEcoder = { var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver; // Adding files - if (action=="add") { + if (action=="add" && !document.getElementById('filesFrame').contentWindow.document.getElementById(location.replace(/\/$/, "").replace(/\//g,"|")+"|"+file)) { // Is this is a file or folder and based on that, set the CSS styling & link actionElemType = file.indexOf(".")>-1 ? "file" : "folder"; cssStyle = actionElemType=="file" ? "pft-file ext-" + file.substr(file.indexOf(".")+1) : "pft-directory";