Bug 1513149 - Hovering the action buttons doesn't display the command associated with the button. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D14172

--HG--
extra : rebase_source : 494ac54cf826305c84453db98efb66648107a59d
extra : amend_source : 3cc5421cea7026aa23dc735f682def5fc1f4a2d3
This commit is contained in:
Paolo Amadini 2018-12-11 18:27:01 +00:00
Родитель 206bc2b3f9
Коммит 2368bbec8d
1 изменённых файлов: 23 добавлений и 18 удалений

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

@ -824,31 +824,36 @@ var DownloadsView = {
* Mouse listeners to handle selection on hover.
*/
onDownloadMouseOver(aEvent) {
if (aEvent.originalTarget.classList.contains("downloadButton")) {
aEvent.target.classList.add("downloadHoveringButton");
let item = aEvent.target.closest("richlistitem,richlistbox");
if (item.localName != "richlistitem") {
return;
}
if (!(this.contextMenuOpen || this.subViewOpen) &&
aEvent.target.parentNode == this.richListBox) {
this.richListBox.selectedItem = aEvent.target;
if (aEvent.target.classList.contains("downloadButton")) {
item.classList.add("downloadHoveringButton");
}
if (!this.contextMenuOpen && !this.subViewOpen) {
this.richListBox.selectedItem = item;
}
},
onDownloadMouseOut(aEvent) {
if (aEvent.originalTarget.classList.contains("downloadButton")) {
aEvent.target.classList.remove("downloadHoveringButton");
let item = aEvent.target.closest("richlistitem,richlistbox");
if (item.localName != "richlistitem") {
return;
}
if (!(this.contextMenuOpen || this.subViewOpen) &&
aEvent.target.parentNode == this.richListBox) {
if (aEvent.target.classList.contains("downloadButton")) {
item.classList.remove("downloadHoveringButton");
}
// If the destination element is outside of the richlistitem, clear the
// selection.
let element = aEvent.relatedTarget;
while (element && element != aEvent.target) {
element = element.parentNode;
}
if (!element) {
if (!this.contextMenuOpen && !this.subViewOpen &&
!item.contains(aEvent.relatedTarget)) {
this.richListBox.selectedIndex = -1;
}
}
},
onDownloadContextMenu(aEvent) {