From aae759c9014784815b512595472a9dda8ba1cd48 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 30 Jul 2012 17:28:27 +0100 Subject: [PATCH] Path fixes, setting new file openFiles value On adding a new file, need to also set the openFiles array value to match the newly given filename --- lib/coder.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/coder.js b/lib/coder.js index 66862c6..0e97a69 100644 --- a/lib/coder.js +++ b/lib/coder.js @@ -1172,7 +1172,7 @@ var ICEcoder = { // Finally we can add the first list item for this file/folder we're adding newLI = document.createElement("li"); newLI.className = cssStyle; - newLI.innerHTML = '        '+file+' '+perms+''; + newLI.innerHTML = '        '+file+' '+perms+''; locNest.nextSibling.appendChild(newLI); locNest.nextSibling.appendChild(newText); @@ -1191,7 +1191,7 @@ var ICEcoder = { if ((elemType==actionElemType && nameLI > file) || (actionElemType=="folder" && elemType=="file") || i==locNest.childNodes.length-1) { newLI = document.createElement("li"); newLI.className = cssStyle; - newLI.innerHTML = '        '+file+' '+perms+''; + newLI.innerHTML = '        '+file+' '+perms+''; // Append or insert depending on which of the above if statements is true i==locNest.childNodes.length-1 ? locNest.appendChild(newLI) : locNest.insertBefore(newLI,locNest.childNodes[i]); i==locNest.childNodes.length-1 ? locNest.appendChild(newText) : locNest.insertBefore(newLI,locNest.childNodes[i+1]); @@ -1202,6 +1202,10 @@ var ICEcoder = { } } } + // If we added a new file, we've saved it under a new filename, so set that + if (actionElemType=="file") { + top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]="/"+file; + } } // Renaming files