From af0a34cf82723796fef104bb6510c35675ffcb1b Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 28 Aug 2021 02:11:40 +0200 Subject: [PATCH] improve iphone fix --- copyparty/web/browser.js | 2 +- copyparty/web/up2k.js | 4 ---- copyparty/web/util.js | 17 +++++++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index d2bd3d8a..e4832994 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -2221,7 +2221,7 @@ var thegrid = (function () { r.setdirty(); }; - var links = QSA('#ghead>a'); + var links = QSA('#ghead a'); for (var a = 0; a < links.length; a++) links[a].onclick = btnclick; diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index aa441e15..486336c8 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -1890,10 +1890,6 @@ function up2k_init(subtle) { if (o) o.addEventListener('click', tgl_fsearch, false); - var nodes = ebi('u2conf').getElementsByTagName('a'); - for (var a = nodes.length - 1; a >= 0; a--) - nodes[a].addEventListener('touchend', nop, false); - ebi('u2etas').onclick = function () { clmod(ebi('u2etas'), 'o', 't'); }; diff --git a/copyparty/web/util.js b/copyparty/web/util.js index 1fc41712..7847bb41 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -592,6 +592,8 @@ var tt = (function () { r.skip = false; return; } + if (QS('body.bbox-open')) + return; var cfg = sread('tooltips'); if (cfg !== null && cfg != '1') @@ -612,18 +614,21 @@ var tt = (function () { clmod(r.tt, 'b', big); r.tt.style.maxWidth = ''; + r.tt.style.left = '0'; + r.tt.style.top = '0'; + r.tt.innerHTML = msg.replace(/\$N/g, "
"); var tw = r.tt.offsetWidth, x = pos.left + (pos.right - pos.left) / 2 - tw / 2; if (x < 0) - x = 0; + x = 8; if (x + tw > window.innerWidth) { - if (!x) - r.tt.style.maxWidth = window.innerWidth + 'px'; + if (x <= 8) + r.tt.style.maxWidth = (window.innerWidth - 16) + 'px'; else - x = window.innerWidth - tw; + x = window.innerWidth - tw - 8; } r.tt.style.left = x + 'px'; @@ -646,10 +651,10 @@ var tt = (function () { f2 = r.hide; r.show = function () { - setTimeout(f1.bind(this), 301); + setTimeout(f1.bind(this), 101); }; r.hide = function () { - setTimeout(f2.bind(this), 301); + setTimeout(f2.bind(this), 101); }; }