fix for the actual safari bug ('for i in arguments' doesn't work in safari)

This commit is contained in:
rolux 2011-05-11 19:18:34 +02:00
parent 70d17f3321
commit feef0a2568
2 changed files with 6 additions and 5 deletions

View file

@ -12,9 +12,6 @@ Ox.Container = function(options, self) {
that.$content = new Ox.Element({})
.options(options || {})
.addClass('OxContent')
/*.appendTo(that)*/;
that.append(that.$content);
// FIXME: that.append(that.$content) works, but
// that.$content.appendTo(that) is broken in Safari
.appendTo(that);
return that;
};

View file

@ -444,6 +444,10 @@ Ox.forEach <f> forEach loop
@*/
Ox.forEach = function(obj, fn) {
var isObject = Ox.isObject(obj), key;
if (Ox.isArguments(obj)) {
// Safari will not loop through an arguments array
obj = Ox.makeArray(obj);
}
for (key in obj) {
key = isObject ? key : parseInt(key);
if (/*hasOwnProperty.call(obj, key) && */fn(obj[key], key) === false) {
@ -3756,7 +3760,7 @@ Ox.loadFile = (function() {
element = document.createElement(
type == 'css' ? 'link' : 'script'
);
element[type == 'css' ? 'href' : 'src'] = file;
element[type == 'css' ? 'href' : 'src'] = file + '?' + Ox.random(1000000);
element.type = type == 'css' ?
'text/css' : 'text/javascript';
if (type == 'css') {