From 372b949622fe13b81a30d22acbf7cac4f5d4af8d Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 19 Jun 2021 01:25:07 +0200 Subject: [PATCH] fix tooltip indicator --- copyparty/web/util.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/copyparty/web/util.js b/copyparty/web/util.js index f5a842bc..4730d72e 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -476,7 +476,7 @@ function hist_replace(url) { var tt = (function () { var r = { "tt": mknod("div"), - "en": bcfg_get('tooltips', true) + "en": true }; r.tt.setAttribute('id', 'tt'); @@ -509,6 +509,17 @@ var tt = (function () { } r.init = function () { + var ttb = ebi('tooltips'); + if (ttb) { + ttb.onclick = function (e) { + ev(e); + r.en = !r.en; + bcfg_set('tooltips', r.en); + r.init(); + }; + r.en = bcfg_get('tooltips', true) + } + var _show = r.en ? show : null, _hide = r.en ? hide : null; @@ -520,15 +531,6 @@ var tt = (function () { o[a].onmouseleave = _hide; } hide(); - - var ttb = ebi('tooltips'); - if (ttb) - ttb.onclick = function (e) { - ev(e); - r.en = !r.en; - bcfg_set('tooltips', r.en); - r.init(); - }; }; return r;