Skip to content

Commit

Permalink
Fix multiple file uploading.
Browse files Browse the repository at this point in the history
Item ID was set statically to uuid(). When two file were uploaded, both
got the same ID, and only one ItemView was shown, though both files were
uploaded. Multiple file uploading now works at least in recent Firefox
and Chromium, but not in Opera.
  • Loading branch information
Peter Kuma committed Jun 12, 2012
1 parent 925e185 commit 883ae48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion fileshack/static/fileshack/js/fileshack.js
Expand Up @@ -89,7 +89,6 @@ var FileShack = new Class({
});

//window.setInterval(function() { this_.update() }, this.options.updateInterval);
window.uuid = uuid();
//this.update();

if ($('watchbtn')) {
Expand Down
7 changes: 6 additions & 1 deletion fileshack/static/fileshack/js/models.js
Expand Up @@ -63,7 +63,7 @@ var Item = new Class({
Extends: Model,

defaults: {
id: uuid(),
id: -1,
type: 'complete', // 'pending', 'unfinished', 'stale', 'complete'.
name: '',
url: '',
Expand All @@ -75,6 +75,11 @@ var Item = new Class({
modified: new Date()
},

initialize: function(attributes) {
this.parent(attributes);
this.id = uuid();
},

update: function(json) {
if (this.type == 'pending')
; // Do nothing.
Expand Down

0 comments on commit 883ae48

Please sign in to comment.