зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1424469 - The Downloads view in the Library window doesn't get focus when opened. r=mak
We have to keep track of the focused element while we remove the richlistbox element temporarily. MozReview-Commit-ID: AePydUyyUS7 --HG-- extra : rebase_source : 1dbab87a07a4d95780e0abf29efec94ea73344cf extra : amend_source : 6e685a648e0ba674eba791e1dc7138f67bd7f1e0
This commit is contained in:
Родитель
50b08d7ef3
Коммит
d5882582e3
|
@ -429,11 +429,15 @@ DownloadsPlacesView.prototype = {
|
|||
xblFields.set(key, value);
|
||||
}
|
||||
|
||||
let oldActiveElement = document.activeElement;
|
||||
let parentNode = this._richlistbox.parentNode;
|
||||
let nextSibling = this._richlistbox.nextSibling;
|
||||
parentNode.removeChild(this._richlistbox);
|
||||
this._richlistbox.prepend(this.batchFragment);
|
||||
parentNode.insertBefore(this._richlistbox, nextSibling);
|
||||
if (oldActiveElement && oldActiveElement != document.activeElement) {
|
||||
oldActiveElement.focus();
|
||||
}
|
||||
|
||||
for (let [key, value] of xblFields) {
|
||||
this._richlistbox[key] = value;
|
||||
|
|
Загрузка…
Ссылка в новой задаче