1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-09 05:34:05 +02:00

Add a delay to link expansion and fix tooltip issues

This commit is contained in:
chylex 2016-05-25 18:34:59 +02:00
parent eccd37a3eb
commit b8a5c2fb9b
2 changed files with 21 additions and 15 deletions

View File

@ -223,13 +223,15 @@
}
if ($TD.expandLinksOnHover){
var expanded = me.attr("data-full-url");
expanded = cutStart(expanded,"https://");
expanded = cutStart(expanded,"http://");
expanded = cutStart(expanded,"www.");
me.attr("td-prev-text",text);
me.text(expanded);
tooltipTimer = window.setTimeout(function(){
var expanded = me.attr("data-full-url");
expanded = cutStart(expanded,"https://");
expanded = cutStart(expanded,"http://");
expanded = cutStart(expanded,"www.");
me.attr("td-prev-text",text);
me.text(expanded);
},200);
}
else{
tooltipTimer = window.setTimeout(function(){
@ -247,8 +249,9 @@
}
}
window.clearTimeout(tooltipTimer);
if (tooltipDisplayed){
window.clearTimeout(tooltipTimer);
tooltipDisplayed = false;
$TD.displayTooltip(null,false);
}

View File

@ -50,13 +50,15 @@
}
if ($TD.expandLinksOnHover){
var expanded = url;
expanded = cutStart(expanded,"https://");
expanded = cutStart(expanded,"http://");
expanded = cutStart(expanded,"www.");
tooltipTimer = window.setTimeout(function(){
var expanded = url;
expanded = cutStart(expanded,"https://");
expanded = cutStart(expanded,"http://");
expanded = cutStart(expanded,"www.");
e.currentTarget.setAttribute("td-prev-text",text);
e.currentTarget.innerHTML = expanded;
e.currentTarget.setAttribute("td-prev-text",text);
e.currentTarget.innerHTML = expanded;
},200);
}
else{
tooltipTimer = window.setTimeout(function(){
@ -77,8 +79,9 @@
}
}
window.clearTimeout(tooltipTimer);
if (tooltipDisplayed){
window.clearTimeout(tooltipTimer);
tooltipDisplayed = false;
$TD.displayTooltip(null,true);
}