Don't update openFiles array on upload

Calling updateFileManagerList now includes a 6th argument and if a true
value is passed, then it's indicating an uploaded file and shouldn't set
the openFiles array value.
This commit is contained in:
Matt Pass
2013-01-22 18:49:48 +00:00
parent ef157d71f2
commit 74f678076a
2 changed files with 4 additions and 4 deletions

View File

@@ -103,7 +103,7 @@ if ($_GET['action']=="upload") {
$this->uploadFile=$uploadDir.$current->name;
$fileName = $current->name;
if ($this->upload($current,$this->uploadFile)) {
echo '<script>action="upload"; top.ICEcoder.updateFileManagerList(\'add\',top.ICEcoder.rightClickedFile.replace(/\|/g,\'/\'),\''.$fileName.'\');</script>';
echo '<script>action="upload"; top.ICEcoder.updateFileManagerList(\'add\',top.ICEcoder.rightClickedFile.replace(/\|/g,\'/\'),\''.$fileName.'\',false,false,true);</script>';
} else {
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload \\n".$fileName."\\n into \\n'+top.ICEcoder.rightClickedFile.replace(/\|/g,'/'))</script>";
}
@@ -135,7 +135,7 @@ if ($_GET['action']=="upload") {
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload whilst in demo mode');</script>";
}
echo "<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.hideFileMenu();top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));</script>";
echo "<script>top.ICEcoder.hideFileMenu();top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));</script>";
}
// If we're due to rename a file/folder...

View File

@@ -652,7 +652,7 @@ var ICEcoder = {
},
// Update the file manager tree list on demand
updateFileManagerList: function(action,location,file,perms,oldName) {
updateFileManagerList: function(action,location,file,perms,oldName,uploaded) {
var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver;
// Adding files
@@ -714,7 +714,7 @@ var ICEcoder = {
}
}
// If we added a new file, we've saved it under a new filename, so set that
if (actionElemType=="file") {
if (actionElemType=="file" && !uploaded) {
top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=location+file;
}
}