Bug 836211 - Give focus to the downloads view if the previous view had focus.

r=mak
This commit is contained in:
Asaf Romano 2013-02-05 15:56:35 +01:00
Родитель 454b0ce43a
Коммит 88fd87f363
1 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -1251,10 +1251,17 @@ let ContentArea = {
},
get currentView() PlacesUIUtils.getViewForNode(this._deck.selectedPanel),
set currentView(aView) {
if (this.currentView != aView)
this._deck.selectedPanel = aView.associatedElement;
return aView;
set currentView(aNewView) {
let oldView = this.currentView;
if (oldView != aNewView) {
this._deck.selectedPanel = aNewView.associatedElement;
// If the content area inactivated view was focused, move focus
// to the new view.
if (document.activeElement == oldView.associatedElement)
aNewView.associatedElement.focus();
}
return aNewView;
},
get currentPlace() this.currentView.place,