mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Remove old browser addListener helper.
This commit is contained in:
@@ -15,27 +15,8 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
// Initialize controls.
|
||||||
addListener(window, 'load', function() {
|
addEventListener('load', function() {
|
||||||
function eventHandler(event) {
|
function eventHandler(event) {
|
||||||
var buildIndex = buildList.selectedIndex,
|
var buildIndex = buildList.selectedIndex,
|
||||||
otherIndex = otherList.selectedIndex,
|
otherIndex = otherList.selectedIndex,
|
||||||
@@ -96,8 +77,8 @@
|
|||||||
return -1;
|
return -1;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
addListener(buildList, 'change', eventHandler);
|
buildList.addEventListener('change', eventHandler);
|
||||||
addListener(otherList, 'change', eventHandler);
|
otherList.addEventListener('change', eventHandler);
|
||||||
});
|
});
|
||||||
|
|
||||||
// The lodash build file path.
|
// The lodash build file path.
|
||||||
|
|||||||
@@ -15,27 +15,8 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
|
||||||
* 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.
|
// Initialize controls.
|
||||||
addListener(window, 'load', function() {
|
addEventListener('load', function() {
|
||||||
function eventHandler(event) {
|
function eventHandler(event) {
|
||||||
var buildIndex = buildList.selectedIndex,
|
var buildIndex = buildList.selectedIndex,
|
||||||
loaderIndex = loaderList.selectedIndex,
|
loaderIndex = loaderList.selectedIndex,
|
||||||
@@ -84,8 +65,8 @@
|
|||||||
return -1;
|
return -1;
|
||||||
}());
|
}());
|
||||||
|
|
||||||
addListener(buildList, 'change', eventHandler);
|
buildList.addEventListener('change', eventHandler);
|
||||||
addListener(loaderList, 'change', eventHandler);
|
loaderList.addEventListener('change', eventHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
var span1 = document.createElement('span');
|
var span1 = document.createElement('span');
|
||||||
|
|||||||
Reference in New Issue
Block a user