Add workaround for hovering above/below the close/pin buttons

This commit is contained in:
Nick Krichevsky 2015-02-22 20:59:33 -05:00
parent d96aa9871a
commit 4da0721020
2 changed files with 27 additions and 3 deletions

View file

@ -62,7 +62,7 @@ i.close{
font-size: 14px;
color:#000;
}
i.close:hover{
i.close:hover,i.close.fakeHover{
color:#E53935
}
i.pin{
@ -75,10 +75,10 @@ i.pin{
i.pin.pinned{
color:#1565C0;
}
i.pin:hover{
i.pin:hover,i.pin.fakeHover{
color:#1565C0;
}
i.pin.pinned:hover{
i.pin.pinned:hover,i.pin.pinned.fakeHover{
color:#000;
}
input#search{

View file

@ -180,7 +180,31 @@ function setupTabs(tabs,callback){
chrome.tabs.update(currentTab.id,{'highlighted':true,'active':true});
});
});
var mouseListenerFunction = function(event){
if (event.clientX>=closeButton.getBoundingClientRect().left && event.clientX<=closeButton.getBoundingClientRect().right){
console.log("Adding!");
closeButton.classList.add('fakeHover');
console.log(closeButton.classList);
}
else{
closeButton.classList.remove('fakeHover');
}
if (event.clientX>=pinButton.getBoundingClientRect().left && event.clientX<=pinButton.getBoundingClientRect().right){
pinButton.classList.add('fakeHover');
}
else{
pinButton.classList.remove('fakeHover');
}
}
li.addEventListener('mousein', mouseListenerFunction);
li.addEventListener('mousemove', mouseListenerFunction);
li.addEventListener('mouseout', function(event){
closeButton.classList.remove('fakeHover');
pinButton.classList.remove('fakeHover');
});
li.appendChild(textSpan);
textSpan.appendChild(pinButton);
textSpan.appendChild(closeButton);