rtl ui bug fix(post title link position)
This commit is contained in:
parent
121ca76db6
commit
656d955dbf
|
@ -279,6 +279,9 @@
|
||||||
var text, clip = new ClipboardJS('.anchor');
|
var text, clip = new ClipboardJS('.anchor');
|
||||||
var headers = singleContentsElem.querySelectorAll("h1, h2, h3, h4");
|
var headers = singleContentsElem.querySelectorAll("h1, h2, h3, h4");
|
||||||
|
|
||||||
|
{{ $languagedir := ($.Param "languagedir" | default "ltr") }}
|
||||||
|
var languagedir = JSON.parse({{ $languagedir | jsonify }});
|
||||||
|
|
||||||
headers ?
|
headers ?
|
||||||
headers.forEach(function (elem) {
|
headers.forEach(function (elem) {
|
||||||
var url = encodeURI(document.location.origin + document.location.pathname);
|
var url = encodeURI(document.location.origin + document.location.pathname);
|
||||||
|
@ -292,11 +295,16 @@
|
||||||
var newElemInner = document.createElement('span');
|
var newElemInner = document.createElement('span');
|
||||||
newElemInner.style.fontSize = '1rem';
|
newElemInner.style.fontSize = '1rem';
|
||||||
newElemInner.style.position = 'absolute';
|
newElemInner.style.position = 'absolute';
|
||||||
newElemInner.style.right = '-2rem';
|
|
||||||
newElemInner.style.top = '50%';
|
newElemInner.style.top = '50%';
|
||||||
newElemInner.style.transform = 'translateY(-50%)';
|
newElemInner.style.transform = 'translateY(-50%)';
|
||||||
newElemInner.innerText = "🔗";
|
newElemInner.innerText = "🔗";
|
||||||
|
|
||||||
|
if (languagedir === "rtl") {
|
||||||
|
newElemInner.style.left = '-2rem';
|
||||||
|
} else {
|
||||||
|
newElemInner.style.right = '-2rem';
|
||||||
|
}
|
||||||
|
|
||||||
newElemOuter.append(newElemInner);
|
newElemOuter.append(newElemInner);
|
||||||
elem.append(newElemOuter);
|
elem.append(newElemOuter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue