Bug 991965 - Inhibit item selection and update commands when the DownloadsBlockedSubview is open. r=paolo

MozReview-Commit-ID: Akly0NenY8Z

--HG--
extra : rebase_source : 0a02a747ec86e17a3218fdb00ed3ba018adc0a99
This commit is contained in:
George Pîrlea 2017-01-21 17:42:36 +00:00
Родитель 9647092161
Коммит 34e7abc036
1 изменённых файлов: 10 добавлений и 2 удалений

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

@ -727,6 +727,11 @@ const DownloadsView = {
*/ */
contextMenuOpen: false, contextMenuOpen: false,
/**
* Indicates whether there is a DownloadsBlockedSubview open.
*/
subViewOpen: false,
/** /**
* Indicates whether we are still loading downloads data asynchronously. * Indicates whether we are still loading downloads data asynchronously.
*/ */
@ -1032,14 +1037,14 @@ const DownloadsView = {
* Mouse listeners to handle selection on hover. * Mouse listeners to handle selection on hover.
*/ */
onDownloadMouseOver(aEvent) { onDownloadMouseOver(aEvent) {
if (!this.contextMenuOpen && if (!(this.contextMenuOpen || this.subViewOpen) &&
aEvent.target.parentNode == this.richListBox) { aEvent.target.parentNode == this.richListBox) {
this.richListBox.selectedItem = aEvent.target; this.richListBox.selectedItem = aEvent.target;
} }
}, },
onDownloadMouseOut(aEvent) { onDownloadMouseOut(aEvent) {
if (!this.contextMenuOpen && if (!(this.contextMenuOpen || this.subViewOpen) &&
aEvent.target.parentNode == this.richListBox) { aEvent.target.parentNode == this.richListBox) {
// If the destination element is outside of the richlistitem, clear the // If the destination element is outside of the richlistitem, clear the
// selection. // selection.
@ -1671,6 +1676,8 @@ const DownloadsBlockedSubview = {
this.element = element; this.element = element;
element.setAttribute("showingsubview", "true"); element.setAttribute("showingsubview", "true");
DownloadsView.subViewOpen = true;
DownloadsViewController.updateCommands();
let e = this.elements; let e = this.elements;
let s = DownloadsCommon.strings; let s = DownloadsCommon.strings;
@ -1697,6 +1704,7 @@ const DownloadsBlockedSubview = {
case "ViewHiding": case "ViewHiding":
this.subview.removeEventListener(event.type, this); this.subview.removeEventListener(event.type, this);
this.element.removeAttribute("showingsubview"); this.element.removeAttribute("showingsubview");
DownloadsView.subViewOpen = false;
delete this.element; delete this.element;
break; break;
default: default: