diff --git a/copyparty/web/ui.css b/copyparty/web/ui.css index 6fd6572e..447c3ac5 100644 --- a/copyparty/web/ui.css +++ b/copyparty/web/ui.css @@ -13,6 +13,7 @@ html { z-index: 9001; } #tt { + max-width: min(34em, calc(100% - 3.3em)); overflow: hidden; margin: .7em 0; padding: 0 1.3em; diff --git a/copyparty/web/util.js b/copyparty/web/util.js index aedf2fca..ecdfdaeb 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -613,7 +613,6 @@ var tt = (function () { if (dir.indexOf('d') + 1) top = true; clmod(r.tt, 'b', big); - r.tt.style.maxWidth = ''; r.tt.style.left = '0'; r.tt.style.top = '0'; @@ -625,10 +624,7 @@ var tt = (function () { x = 8; if (x + tw >= window.innerWidth - 8) { - if (x <= 8) - r.tt.style.maxWidth = (window.innerWidth - 16) + 'px'; - else - x = window.innerWidth - tw - 8; + x = window.innerWidth - tw - 8; } r.tt.style.left = x + 'px'; @@ -650,13 +646,23 @@ var tt = (function () { if (is_touch && IPHONE) { var f1 = r.show, - f2 = r.hide; + f2 = r.hide, + q = []; + + // if an onclick-handler creates a new timer, + // iOS 13.1.2 delays the entire handler by up to 401ms, + // win by using a shared timer instead + + timer.add(function () { + while (q.length && Date.now() >= q[0][0]) + q.shift()[1](); + }); r.show = function () { - setTimeout(f1.bind(this), 401); + q.push([Date.now() + 100, f1.bind(this)]); }; r.hide = function () { - setTimeout(f2.bind(this), 401); + q.push([Date.now() + 100, f2.bind(this)]); }; }