Fixed minor issue in `WoltLab/WCF/Controller/Clipboard`
authorAlexander Ebert <ebert@woltlab.com>
Sat, 30 May 2015 21:41:02 +0000 (23:41 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 30 May 2015 21:41:02 +0000 (23:41 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Controller/Clipboard.js

index d1545aad215ccba189176eb8b72ae000b4e17e21..5fe631d18fd48e87ff547fb42b45343e5edcceb1 100644 (file)
@@ -116,24 +116,17 @@ define(
                 */
                _initEditors: function() {
                        var getTypes = function(editor) {
-                               var tmp = null;
-                               
                                try {
                                        var types = editor.getAttribute('data-types');
                                        if (typeof types === 'string') {
-                                               tmp = JSON.parse('{ "types": ' + types.replace(/'/g, '"') + '}');
+                                               return JSON.parse('{ "types": ' + types.replace(/'/g, '"') + '}').types;
                                        }
                                }
                                catch (e) {
                                        throw new Error("Expected a valid 'data-type' attribute for element '" + DOMUtil.identify(editor) + "'.");
                                }
                                
-                               return tmp.types;
-                               if (types !== null) {
-                                       types = types.types;
-                               }
-                               
-                               return types;
+                               return [];
                        };
                        
                        var editors = document.getElementsByClassName('jsClipboardEditor');