Check for file/folder at location before adding

This commit is contained in:
Matt Pass
2013-03-19 17:11:37 +00:00
parent 9fa87c5141
commit 9197d24fff

View File

@@ -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";