Incorrect position of the quote tooltip on touch devices
authorAlexander Ebert <ebert@woltlab.com>
Sun, 30 May 2021 10:23:51 +0000 (12:23 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 30 May 2021 10:23:51 +0000 (12:23 +0200)
ts/WoltLabSuite/Core/Ui/Message/Quote.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js

index 3f2dbb23ea009d748ec19f8a2e56a5c2fa59d136..c60e5fc0d9a72e26b6c2f9a1acb0c6d71784ff4f 100644 (file)
@@ -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
index e8e52f0268d20d0495512bd898fe5da0cb06df39..917194b59933812ce50448d5618a62847ae55a96 100644 (file)
@@ -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 = "";