Fix clearing of obsolete clipboard buttons
authorMatthias Schmidt <gravatronics@live.com>
Thu, 15 Apr 2021 08:02:24 +0000 (10:02 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 15 Apr 2021 08:02:24 +0000 (10:02 +0200)
ts/WoltLabSuite/Core/Controller/Clipboard.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Controller/Clipboard.js

index 9dde00d6c47fc4465050b32f9ff46bbd75a46488..41c73fd20d2f4d8ee0ea39d01fa0089d98b964c9 100644 (file)
@@ -455,7 +455,7 @@ class ControllerClipboard {
 
     // clear editors
     this.editors.forEach((editor, typeName) => {
-      if (keepEditors.includes(typeName)) {
+      if (!keepEditors.includes(typeName)) {
         UiPageAction.remove(`wcfClipboard-${typeName}`);
 
         this.editorDropdowns.get(typeName)!.innerHTML = "";
index b78b952464791831a1d4e4265dba99f83c8dc8fe..376120ad0b80d779c33b0c29a260b43cbe92fad6 100644 (file)
@@ -380,7 +380,7 @@ define(["require", "exports", "tslib", "../Ajax", "../Core", "../Dom/Change/List
             const keepEditors = Object.keys(data.returnValues.items || {});
             // clear editors
             this.editors.forEach((editor, typeName) => {
-                if (keepEditors.includes(typeName)) {
+                if (!keepEditors.includes(typeName)) {
                     UiPageAction.remove(`wcfClipboard-${typeName}`);
                     this.editorDropdowns.get(typeName).innerHTML = "";
                 }