mirror of
https://github.com/9001/copyparty.git
synced 2025-08-19 01:42:20 -06:00
another attempt at fixing tooltips on iphone
This commit is contained in:
parent
0194eeb31f
commit
890c310880
|
@ -7,7 +7,8 @@ if (!window['console'])
|
||||||
|
|
||||||
|
|
||||||
var is_touch = 'ontouchstart' in window,
|
var is_touch = 'ontouchstart' in window,
|
||||||
ANDROID = /(android)/i.test(navigator.userAgent);
|
IPHONE = /iPhone|iPad|iPod/i.test(navigator.userAgent),
|
||||||
|
ANDROID = /android/i.test(navigator.userAgent);
|
||||||
|
|
||||||
|
|
||||||
// error handler for mobile devices
|
// error handler for mobile devices
|
||||||
|
@ -547,12 +548,25 @@ var tt = (function () {
|
||||||
clmod(r.tt, 'show', 1);
|
clmod(r.tt, 'show', 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
r.hide = function () {
|
r.hide = function (e) {
|
||||||
|
ev(e);
|
||||||
clmod(r.tt, 'show');
|
clmod(r.tt, 'show');
|
||||||
if (r.el)
|
if (r.el)
|
||||||
r.el.removeEventListener('mouseleave', r.hide);
|
r.el.removeEventListener('mouseleave', r.hide);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (is_touch && IPHONE) {
|
||||||
|
var f1 = r.show,
|
||||||
|
f2 = r.hide;
|
||||||
|
|
||||||
|
r.show = function () {
|
||||||
|
setTimeout(f1.bind(this), 301);
|
||||||
|
};
|
||||||
|
r.hide = function () {
|
||||||
|
setTimeout(f2.bind(this), 301);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
r.tt.onclick = r.hide;
|
r.tt.onclick = r.hide;
|
||||||
|
|
||||||
r.att = function (ctr) {
|
r.att = function (ctr) {
|
||||||
|
|
Loading…
Reference in a new issue