IE8 don't knows the Array.forEach function (simple version fix)
parent
b08a6e522f
commit
566034ddf0
|
@ -162,6 +162,16 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// add forEach function to Array.prototype for IE8
|
||||||
|
if (!('forEach' in Array.prototype)) {
|
||||||
|
Array.prototype.forEach= function(action, that /*opt*/) {
|
||||||
|
for (var i= 0, n= this.length; i<n; i++)
|
||||||
|
if (i in this)
|
||||||
|
action.call(that, this[i], i, this);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Get my authorID
|
// Get my authorID
|
||||||
var authorId = parent.parent.pad.myUserInfo.userId;
|
var authorId = parent.parent.pad.myUserInfo.userId;
|
||||||
// Rewrite apool authors with my author information
|
// Rewrite apool authors with my author information
|
||||||
|
|
|
@ -80,6 +80,15 @@ window.html10n = (function(window, document, undefined) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fix Array.prototype.forEach in IE
|
||||||
|
if (!('forEach' in Array.prototype)) {
|
||||||
|
Array.prototype.forEach= function(action, that /*opt*/) {
|
||||||
|
for (var i= 0, n= this.length; i<n; i++)
|
||||||
|
if (i in this)
|
||||||
|
action.call(that, this[i], i, this);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MicroEvent - to make any js object an event emitter (server or browser)
|
* MicroEvent - to make any js object an event emitter (server or browser)
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue