mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-22 02:41:23 +02:00
Allow setting text-align on popovers
This commit is contained in:
parent
b35cc437d3
commit
014abdcc00
@ -60,7 +60,6 @@ function showPopover() {
|
|||||||
pendingTarget = null;
|
pendingTarget = null;
|
||||||
|
|
||||||
const popoverType = activeTarget.dataset.popoverType;
|
const popoverType = activeTarget.dataset.popoverType;
|
||||||
const contentMaxWidth = activeTarget.dataset.popoverMaxWidth || defaultMaxWidth;
|
|
||||||
|
|
||||||
if (popoverType === "text") {
|
if (popoverType === "text") {
|
||||||
const text = activeTarget.dataset.popoverText;
|
const text = activeTarget.dataset.popoverText;
|
||||||
@ -87,6 +86,14 @@ function showPopover() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const contentMaxWidth = activeTarget.dataset.popoverMaxWidth || defaultMaxWidth;
|
||||||
|
|
||||||
|
if (activeTarget.dataset.popoverTextAlign !== undefined) {
|
||||||
|
contentElement.style.textAlign = activeTarget.dataset.popoverTextAlign;
|
||||||
|
} else {
|
||||||
|
contentElement.style.removeProperty("text-align");
|
||||||
|
}
|
||||||
|
|
||||||
contentElement.style.maxWidth = contentMaxWidth;
|
contentElement.style.maxWidth = contentMaxWidth;
|
||||||
containerElement.style.display = "block";
|
containerElement.style.display = "block";
|
||||||
activeTarget.classList.add("popover-active");
|
activeTarget.classList.add("popover-active");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user