projects
/
Plinn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f12db31
)
Mise à jour de la ligne du listing lors d'un écrasement.
author
Benoît Pin
<pin@cri.ensmp.fr>
Fri, 31 Oct 2014 13:47:15 +0000
(14:47 +0100)
committer
Benoît Pin
<pin@cri.ensmp.fr>
Fri, 31 Oct 2014 13:47:15 +0000
(14:47 +0100)
skins/ajax_scripts/folder_contents_script.js
patch
|
blob
|
history
diff --git
a/skins/ajax_scripts/folder_contents_script.js
b/skins/ajax_scripts/folder_contents_script.js
index
6480f9d
..
066bfc0
100644
(file)
--- a/
skins/ajax_scripts/folder_contents_script.js
+++ b/
skins/ajax_scripts/folder_contents_script.js
@@
-352,14
+352,25
@@
DDFolderUploader.prototype.beforeUpload = function(item) {
DDFolderUploader.prototype.uploadCompleteHandlerCB = function(req) {
var item = this.uploadedItem;
var row = getCopyOfNode(req.responseXML.documentElement.firstChild);
DDFolderUploader.prototype.uploadCompleteHandlerCB = function(req) {
var item = this.uploadedItem;
var row = getCopyOfNode(req.responseXML.documentElement.firstChild);
- row.className = item.className;
if (req.status === 200) {
// update
if (req.status === 200) {
// update
- console.log('todo');
+ this.listing.removeChild(item);
+ var itemUrl = row.getElementsByTagName('a')[0].href;
+ var links = this.listing.getElementsByTagName('a');
+ var i, existingRow;
+ for (i=0 ; i < links.length ; i++) {
+ if (links[i].href === itemUrl) {
+ existingRow = links[i].parentNode.parentNode;
+ row.className = existingRow.className;
+ this.listing.replaceChild(row, existingRow);
+ break;
+ }
+ }
}
else if(req.status === 201) {
// creation
}
else if(req.status === 201) {
// creation
+ row.className = item.className;
this.listing.replaceChild(row, item);
this.progressBarMaxSize = row.clientWidth;
}
this.listing.replaceChild(row, item);
this.progressBarMaxSize = row.clientWidth;
}