mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Clear tooltips on blur as well as mouseleave (#420)
Addresses https://github.com/zenorocha/clipboard.js/pull/419#issuecomment-304734327
This commit is contained in:
parent
10468f0c0a
commit
16d4404462
@ -1,10 +1,13 @@
|
|||||||
var btns = document.querySelectorAll('.btn');
|
var btns = document.querySelectorAll('.btn');
|
||||||
|
|
||||||
for (var i = 0; i < btns.length; i++) {
|
for (var i = 0; i < btns.length; i++) {
|
||||||
btns[i].addEventListener('mouseleave', function(e) {
|
btns[i].addEventListener('mouseleave', clearTooltip);
|
||||||
e.currentTarget.setAttribute('class', 'btn');
|
btns[i].addEventListener('blur', clearTooltip);
|
||||||
e.currentTarget.removeAttribute('aria-label');
|
}
|
||||||
});
|
|
||||||
|
function clearTooltip(e) {
|
||||||
|
e.currentTarget.setAttribute('class', 'btn');
|
||||||
|
e.currentTarget.removeAttribute('aria-label');
|
||||||
}
|
}
|
||||||
|
|
||||||
function showTooltip(elem, msg) {
|
function showTooltip(elem, msg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user