rtl ui bug fix(post title link position)

This commit is contained in:
zzossig 2020-02-02 19:20:15 +09:00
parent 121ca76db6
commit 656d955dbf
1 changed files with 9 additions and 1 deletions

View File

@ -279,6 +279,9 @@
var text, clip = new ClipboardJS('.anchor');
var headers = singleContentsElem.querySelectorAll("h1, h2, h3, h4");
{{ $languagedir := ($.Param "languagedir" | default "ltr") }}
var languagedir = JSON.parse({{ $languagedir | jsonify }});
headers ?
headers.forEach(function (elem) {
var url = encodeURI(document.location.origin + document.location.pathname);
@ -292,11 +295,16 @@
var newElemInner = document.createElement('span');
newElemInner.style.fontSize = '1rem';
newElemInner.style.position = 'absolute';
newElemInner.style.right = '-2rem';
newElemInner.style.top = '50%';
newElemInner.style.transform = 'translateY(-50%)';
newElemInner.innerText = "🔗";
if (languagedir === "rtl") {
newElemInner.style.left = '-2rem';
} else {
newElemInner.style.right = '-2rem';
}
newElemOuter.append(newElemInner);
elem.append(newElemOuter);