From e1c526c1d2422e39c1d6ff6d28e203b96b0b7b97 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 30 May 2021 12:23:51 +0200 Subject: [PATCH] Incorrect position of the quote tooltip on touch devices --- ts/WoltLabSuite/Core/Ui/Message/Quote.ts | 7 +++++++ .../install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js | 7 +++++++ 2 files changed, 14 insertions(+) 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 = ""; -- 2.20.1