Built motion from commit 76eb00b9e.|1.0.24
[motion.git] / public / bower_components / lodash / perf / asset / perf-ui.js
index e3ed64b..049d4d2 100644 (file)
 
   /*--------------------------------------------------------------------------*/
 
-  /**
-   * Registers an event listener on an element.
-   *
-   * @private
-   * @param {Element} element The element.
-   * @param {string} eventName The name of the event.
-   * @param {Function} handler The event handler.
-   * @returns {Element} The element.
-   */
-  function addListener(element, eventName, handler) {
-    if (typeof element.addEventListener != 'undefined') {
-      element.addEventListener(eventName, handler, false);
-    } else if (typeof element.attachEvent != 'undefined') {
-      element.attachEvent('on' + eventName, handler);
-    }
-  }
-
-  /*--------------------------------------------------------------------------*/
-
   // Initialize controls.
-  addListener(window, 'load', function() {
+  addEventListener('load', function() {
     function eventHandler(event) {
       var buildIndex = buildList.selectedIndex,
           otherIndex = otherList.selectedIndex,
@@ -58,7 +39,7 @@
     span1.innerHTML =
       '<label for="perf-build">Build: </label>' +
       '<select id="perf-build">' +
-      '<option value="lodash">lodash</option>' +
+      '<option value="lodash">lodash (production)</option>' +
       '</select>';
 
     var span2 = document.createElement('span');
@@ -96,8 +77,8 @@
       return -1;
     }());
 
-    addListener(buildList, 'change', eventHandler);
-    addListener(otherList, 'change', eventHandler);
+    buildList.addEventListener('change', eventHandler);
+    otherList.addEventListener('change', eventHandler);
   });
 
   // The lodash build file path.