diff options
| author | 2018-12-27 03:49:20 +0100 | |
|---|---|---|
| committer | 2018-12-27 03:49:20 +0100 | |
| commit | f9555db678679d04fdc28bb2d31eb00135209a16 (patch) | |
| tree | 1a897a4820733c30fed13541d4cca3fd928a65f0 | |
| parent | caa893e14b46bc9b52f251ca93eada0c57634302 (diff) | |
IE11 fixes
| -rw-r--r-- | p/scripts/main.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js index 227a4b47a..7b49ebeb2 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -49,9 +49,10 @@ function redirect(url, new_tab) { function needsScroll(elem) { const winBottom = document.documentElement.scrollTop + document.documentElement.clientHeight, - elemBottom = elem.offsetTop + elem.offsetHeight; - return (elem.offsetTop < document.documentElement.scrollTop || elemBottom > winBottom) ? - elem.offsetTop - (document.documentElement.clientHeight / 2) : 0; + elemTop = elem.offsetParent.offsetTop + elem.offsetTop, + elemBottom = elemTop + elem.offsetHeight; + return (elemTop < document.documentElement.scrollTop || elemBottom > winBottom) ? + elemTop - (document.documentElement.clientHeight / 2) : 0; } function str2int(str) { @@ -178,7 +179,8 @@ function send_mark_read_queue(queue, asRead) { div.querySelectorAll('a.read > .icon').forEach(function (img) { img.outerHTML = myIcons.read; }); inc--; } else { - div.classList.add('not_read', 'keep_unread'); + div.classList.add('not_read'); + div.classList.add('keep_unread'); //Split for IE11 div.querySelectorAll('a.read').forEach(function (a) { a.setAttribute('href', a.getAttribute('href').replace('&is_read=1', '')); }); div.querySelectorAll('a.read > .icon').forEach(function (img) { img.outerHTML = myIcons.unread; }); inc++; |
