Eagerly set up Dictionaries
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 22 May 2015 21:54:56 +0000 (23:54 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 22 May 2015 21:54:56 +0000 (23:54 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Controller/Popover.js
wcfsetup/install/files/js/WoltLab/WCF/UI/Dialog.js
wcfsetup/install/files/js/WoltLab/WCF/UI/Dropdown/Simple.js

index 8334bf604e9d04da9e2fe1b6a88ef93e983a2c96..3c9790d43caf3d725732aa879fdee588e9c60092 100644 (file)
@@ -11,9 +11,9 @@ define(['Dictionary', 'Environment', 'DOM/Util', 'UI/Alignment'], function(Dicti
        
        var _activeId = null;
        var _baseHeight = 0;
-       var _cache = null;
-       var _elements = null;
-       var _handlers = null;
+       var _cache = new Dictionary();
+       var _elements = new Dictionary();
+       var _handlers = new Dictionary();
        var _hoverId = null;
        var _suspended = false;
        var _timeoutEnter = null;
@@ -48,10 +48,6 @@ define(['Dictionary', 'Environment', 'DOM/Util', 'UI/Alignment'], function(Dicti
                                return;
                        }
                        
-                       _cache = new Dictionary();
-                       _elements = new Dictionary();
-                       _handlers = new Dictionary();
-                       
                        _popover = document.createElement('div');
                        _popover.classList.add('popover');
                        
index 3d9258cacbdb282c225d1fb3076a5ab2ea6aa62d..f181f047710094fc3318fa60f5b0d723b2a62767 100644 (file)
@@ -11,7 +11,7 @@ define(['enquire', 'Core', 'Dictionary', 'Environment', 'Language', 'DOM/Util'],
        
        var _activeDialog = null;
        var _container = null;
-       var _dialogs = null;
+       var _dialogs = new Dictionary();
        var _dialogFullHeight = false;
        var _keyupListener = null;
        
@@ -31,8 +31,6 @@ define(['enquire', 'Core', 'Dictionary', 'Environment', 'Language', 'DOM/Util'],
                        
                        document.body.appendChild(_container);
                        
-                       _dialogs = new Dictionary();
-                       
                        _keyupListener = (function(event) {
                                if (event.keyCode === 27) {
                                        if (event.target.nodeName !== 'INPUT' && event.target.nodeName !== 'TEXTAREA') {
index 790f623a8b9a9912d758f7bea01a4405355ecf3a..9a2823d75df6bc700d150356175cd002ae098592 100644 (file)
@@ -13,9 +13,9 @@ define(
        "use strict";
        
        var _availableDropdowns = null;
-       var _callbacks = null;
-       var _dropdowns = null;
-       var _menus = null;
+       var _callbacks = new CallbackList();
+       var _dropdowns = new Dictionary();
+       var _menus = new Dictionary();
        var _menuContainer = null;
        
        /**
@@ -31,10 +31,6 @@ define(
                        _menuContainer.setAttribute('id', 'dropdownMenuContainer');
                        document.body.appendChild(_menuContainer);
                        
-                       _callbacks = new CallbackList();
-                       _dropdowns = new Dictionary();
-                       _menus = new Dictionary();
-                       
                        _availableDropdowns = document.getElementsByClassName('dropdownToggle');
                        
                        this.initAll();