mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-03 01:19:44 +00:00
Monotone-Parent: ac0d12f89b420e5f1e825cebddb440417e76ce4b
Monotone-Revision: 015d6494690201ec056395687392e68803e04210 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-20T14:37:53
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* -*- Mode: js-mode; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
if (NodeList) {
|
||||
var _each = NodeList.prototype.forEach;
|
||||
if (!_each) {
|
||||
_each = function NodeList_each(iterator, context) {
|
||||
for (var i = 0, length = this.length >>> 0; i < length; i++) {
|
||||
if (i in this) iterator.call(context, this[i], i, this);
|
||||
[HTMLCollection, NodeList].each(
|
||||
function (contClass) {
|
||||
if (contClass) {
|
||||
var _each = contClass.prototype.forEach;
|
||||
if (!_each) {
|
||||
_each = function HTMLElement_each(iterator, context) {
|
||||
for (var i = 0, length = this.length >>> 0; i < length; i++) {
|
||||
if (i in this) iterator.call(context, this[i], i, this);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
contClass.prototype._each = _each;
|
||||
Object.extend(contClass.prototype, Enumerable);
|
||||
}
|
||||
}
|
||||
NodeList.prototype._each = _each;
|
||||
Object.extend(NodeList.prototype, Enumerable);
|
||||
}
|
||||
);
|
||||
|
||||
/* custom extensions to the DOM api */
|
||||
Element.addMethods({
|
||||
|
||||
Reference in New Issue
Block a user