зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
206bc2b3f9
Коммит
2368bbec8d
|
@ -824,30 +824,35 @@ 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 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) {
|
||||
this.richListBox.selectedIndex = -1;
|
||||
}
|
||||
|
||||
if (aEvent.target.classList.contains("downloadButton")) {
|
||||
item.classList.remove("downloadHoveringButton");
|
||||
}
|
||||
|
||||
// If the destination element is outside of the richlistitem, clear the
|
||||
// selection.
|
||||
if (!this.contextMenuOpen && !this.subViewOpen &&
|
||||
!item.contains(aEvent.relatedTarget)) {
|
||||
this.richListBox.selectedIndex = -1;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче