Allow multiple instances of the quote manager on one page
authorAlexander Ebert <ebert@woltlab.com>
Thu, 9 Dec 2021 18:07:23 +0000 (19:07 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 9 Dec 2021 18:07:23 +0000 (19:07 +0100)
ts/WoltLabSuite/Core/Ui/Message/Quote.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Quote.js
wcfsetup/install/files/style/ui/tooltip.scss

index e26c71e69216e66dacd39724a3014f76875d3718..9557434441b42bbb77de81acb3d6f97e33166e38 100644 (file)
@@ -438,11 +438,7 @@ export class UiMessageQuote implements AjaxCallbackObject {
   }
 
   private initCopyQuote(supportDirectInsert: boolean): void {
-    const copyQuote = document.getElementById("quoteManagerCopy");
-    copyQuote?.remove();
-
-    this.copyQuote.id = "quoteManagerCopy";
-    this.copyQuote.classList.add("balloonTooltip", "interactive");
+    this.copyQuote.classList.add("balloonTooltip", "interactive", "quoteManagerCopy");
 
     const buttonSaveQuote = document.createElement("span");
     buttonSaveQuote.classList.add("jsQuoteManagerStore");
index fb175a0416a30a772013b6f11dc38f803e2cbf50..9f588177ee829df04610d782a401a6a942e84e44 100644 (file)
@@ -321,10 +321,7 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Event/
             return coordinates;
         }
         initCopyQuote(supportDirectInsert) {
-            const copyQuote = document.getElementById("quoteManagerCopy");
-            copyQuote === null || copyQuote === void 0 ? void 0 : copyQuote.remove();
-            this.copyQuote.id = "quoteManagerCopy";
-            this.copyQuote.classList.add("balloonTooltip", "interactive");
+            this.copyQuote.classList.add("balloonTooltip", "interactive", "quoteManagerCopy");
             const buttonSaveQuote = document.createElement("span");
             buttonSaveQuote.classList.add("jsQuoteManagerStore");
             buttonSaveQuote.textContent = Language.get("wcf.message.quote.quoteSelected");
index b39e04be2c629b9133c45ad325db34f787c308a8..4123849b3880708701b41b2eff96a4e5d173b017 100644 (file)
        }
 }
 
-#quoteManagerCopy {
-       /* Prevent the tooltip from being selected on touch devices. */
+.quoteManagerCopy {
        -webkit-user-select: none;
-       -moz-user-select: none;
-       -ms-user-select: none;
        user-select: none;
-
        white-space: nowrap;
        z-index: 350;