зеркало из https://github.com/mozilla/pjs.git
Bug 595333 - Downloads started during DownloadView initialization are added twice [r=mfinkle]
This commit is contained in:
Родитель
8bedc9c8f0
Коммит
53ac8bc028
|
@ -73,23 +73,26 @@ var DownloadsView = {
|
|||
},
|
||||
|
||||
_createItem: function dv__createItem(aAttrs) {
|
||||
let item = document.createElement("richlistitem");
|
||||
|
||||
// Copy the attributes from the argument into the item
|
||||
for (let attr in aAttrs)
|
||||
item.setAttribute(attr, aAttrs[attr]);
|
||||
|
||||
// Initialize other attributes
|
||||
item.setAttribute("typeName", "download");
|
||||
item.setAttribute("id", "dl-" + aAttrs.id);
|
||||
item.setAttribute("downloadID", aAttrs.id);
|
||||
item.setAttribute("iconURL", "moz-icon://" + aAttrs.file + "?size=32");
|
||||
item.setAttribute("lastSeconds", Infinity);
|
||||
|
||||
// Initialize more complex attributes
|
||||
this._updateTime(item);
|
||||
this._updateStatus(item);
|
||||
// Make sure this doesn't already exist
|
||||
let item = this.getElementForDownload(aAttrs.id);
|
||||
if (!item) {
|
||||
item = document.createElement("richlistitem");
|
||||
|
||||
// Copy the attributes from the argument into the item
|
||||
for (let attr in aAttrs)
|
||||
item.setAttribute(attr, aAttrs[attr]);
|
||||
|
||||
// Initialize other attributes
|
||||
item.setAttribute("typeName", "download");
|
||||
item.setAttribute("id", "dl-" + aAttrs.id);
|
||||
item.setAttribute("downloadID", aAttrs.id);
|
||||
item.setAttribute("iconURL", "moz-icon://" + aAttrs.file + "?size=32");
|
||||
item.setAttribute("lastSeconds", Infinity);
|
||||
|
||||
// Initialize more complex attributes
|
||||
this._updateTime(item);
|
||||
this._updateStatus(item);
|
||||
}
|
||||
return item;
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче