Bug 1144377 - hover state on reading list sidebar items remains after the mouse leaves the list, r=jaws.

This commit is contained in:
Florian Quèze 2015-03-19 15:50:23 -07:00
parent b80f92a0b2
commit d13830aaa4
2 changed files with 8 additions and 8 deletions

View File

@ -165,7 +165,7 @@ let RLSidebar = {
}, },
/** /**
* The currently active element in the list. * The list item displayed in the current tab.
* @type {Element} * @type {Element}
*/ */
get activeItem() { get activeItem() {
@ -204,7 +204,7 @@ let RLSidebar = {
}, },
/** /**
* The currently selected item in the list. * The list item selected with the keyboard.
* @type {Element} * @type {Element}
*/ */
get selectedItem() { get selectedItem() {
@ -366,15 +366,14 @@ let RLSidebar = {
}, },
/** /**
* Handle a mousemove event over the list box. * Handle a mousemove event over the list box:
* If the hovered item isn't the selected one, clear the selection.
* @param {Event} event - Triggering event. * @param {Event} event - Triggering event.
*/ */
onListMouseMove(event) { onListMouseMove(event) {
let itemNode = this.findParentItemNode(event.target); let itemNode = this.findParentItemNode(event.target);
if (!itemNode) if (itemNode != this.selectedItem)
return; this.selectedItem = null;
this.selectedItem = itemNode;
}, },
/** /**

View File

@ -84,11 +84,12 @@ body {
color: #008ACB; color: #008ACB;
} }
.item:not(:hover) .remove-button { .item:not(:hover):not(.selected) .remove-button {
display: none; display: none;
} }
.remove-button { .remove-button {
padding: 0;
width: 16px; width: 16px;
height: 16px; height: 16px;
background-size: contain; background-size: contain;