Fixed page action for clipboard objects
authorAlexander Ebert <ebert@woltlab.com>
Tue, 19 Jul 2016 13:12:51 +0000 (15:12 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 19 Jul 2016 13:12:56 +0000 (15:12 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Controller/Clipboard.js

index 1568b3187fa94a53c9f170fc89aec33a62909ce0..c467e760ee8e403ba95915d0363d2e0a7674bdf4 100644 (file)
@@ -469,7 +469,7 @@ define(
                        }
                        
                        // rebuild editors
-                       var created, dropdown, editor, typeData;
+                       var actionName, created, dropdown, editor, typeData;
                        var divider, item, itemData, itemIndex, label, unmarkAll;
                        //noinspection JSUnresolvedVariable
                        for (typeName in data.returnValues.items) {
@@ -537,7 +537,14 @@ define(
                                dropdown.appendChild(unmarkAll);
                                
                                if (keepEditors.indexOf(typeName) !== -1) {
-                                       UiPageAction.add('wcfClipboard-' + typeName, editor);
+                                       actionName = 'wcfClipboard-' + typeName;
+                                       
+                                       if (UiPageAction.has(actionName)) {
+                                               UiPageAction.show(actionName);
+                                       }
+                                       else {
+                                               UiPageAction.add(actionName, editor);
+                                       }
                                }
                                
                                if (created) {