From: Alexander Ebert Date: Sun, 30 May 2021 10:23:51 +0000 (+0200) Subject: Incorrect position of the quote tooltip on touch devices X-Git-Tag: 5.4.0_Beta_1~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e1c526c1d2422e39c1d6ff6d28e203b96b0b7b97;p=GitHub%2FWoltLab%2FWCF.git Incorrect position of the quote tooltip on touch devices --- diff --git a/ts/WoltLabSuite/Core/Ui/Message/Quote.ts b/ts/WoltLabSuite/Core/Ui/Message/Quote.ts index 3f2dbb23ea..c60e5fc0d9 100644 --- a/ts/WoltLabSuite/Core/Ui/Message/Quote.ts +++ b/ts/WoltLabSuite/Core/Ui/Message/Quote.ts @@ -359,6 +359,10 @@ export class UiMessageQuote implements AjaxCallbackObject { } this.copyQuote.classList.add("active"); + const wasInaccessible = this.copyQuote.classList.contains("touchForceInaccessible"); + if (wasInaccessible) { + this.copyQuote.classList.remove("touchForceInaccessible"); + } const coordinates = this.getElementBoundaries(selection)!; const dimensions = { height: this.copyQuote.offsetHeight, width: this.copyQuote.offsetWidth }; @@ -375,6 +379,9 @@ export class UiMessageQuote implements AjaxCallbackObject { this.copyQuote.style.setProperty("top", `${coordinates.bottom + 7}px`); this.copyQuote.style.setProperty("left", `${left}px`); this.copyQuote.classList.remove("active"); + if (wasInaccessible) { + this.copyQuote.classList.add("touchForceInaccessible"); + } if (!this.timerSelectionChange) { // reset containerID diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js index e8e52f0268..917194b599 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js @@ -252,6 +252,10 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Event/ return; } this.copyQuote.classList.add("active"); + const wasInaccessible = this.copyQuote.classList.contains("touchForceInaccessible"); + if (wasInaccessible) { + this.copyQuote.classList.remove("touchForceInaccessible"); + } const coordinates = this.getElementBoundaries(selection); const dimensions = { height: this.copyQuote.offsetHeight, width: this.copyQuote.offsetWidth }; let left = (coordinates.right - coordinates.left) / 2 - dimensions.width / 2 + coordinates.left; @@ -266,6 +270,9 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Event/ this.copyQuote.style.setProperty("top", `${coordinates.bottom + 7}px`); this.copyQuote.style.setProperty("left", `${left}px`); this.copyQuote.classList.remove("active"); + if (wasInaccessible) { + this.copyQuote.classList.add("touchForceInaccessible"); + } if (!this.timerSelectionChange) { // reset containerID this.activeMessageId = "";