fix for the actual safari bug ('for i in arguments' doesn't work in safari)
This commit is contained in:
parent
70d17f3321
commit
feef0a2568
2 changed files with 6 additions and 5 deletions
|
@ -12,9 +12,6 @@ Ox.Container = function(options, self) {
|
||||||
that.$content = new Ox.Element({})
|
that.$content = new Ox.Element({})
|
||||||
.options(options || {})
|
.options(options || {})
|
||||||
.addClass('OxContent')
|
.addClass('OxContent')
|
||||||
/*.appendTo(that)*/;
|
.appendTo(that);
|
||||||
that.append(that.$content);
|
|
||||||
// FIXME: that.append(that.$content) works, but
|
|
||||||
// that.$content.appendTo(that) is broken in Safari
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
|
@ -444,6 +444,10 @@ Ox.forEach <f> forEach loop
|
||||||
@*/
|
@*/
|
||||||
Ox.forEach = function(obj, fn) {
|
Ox.forEach = function(obj, fn) {
|
||||||
var isObject = Ox.isObject(obj), key;
|
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) {
|
for (key in obj) {
|
||||||
key = isObject ? key : parseInt(key);
|
key = isObject ? key : parseInt(key);
|
||||||
if (/*hasOwnProperty.call(obj, key) && */fn(obj[key], key) === false) {
|
if (/*hasOwnProperty.call(obj, key) && */fn(obj[key], key) === false) {
|
||||||
|
@ -3756,7 +3760,7 @@ Ox.loadFile = (function() {
|
||||||
element = document.createElement(
|
element = document.createElement(
|
||||||
type == 'css' ? 'link' : 'script'
|
type == 'css' ? 'link' : 'script'
|
||||||
);
|
);
|
||||||
element[type == 'css' ? 'href' : 'src'] = file;
|
element[type == 'css' ? 'href' : 'src'] = file + '?' + Ox.random(1000000);
|
||||||
element.type = type == 'css' ?
|
element.type = type == 'css' ?
|
||||||
'text/css' : 'text/javascript';
|
'text/css' : 'text/javascript';
|
||||||
if (type == 'css') {
|
if (type == 'css') {
|
||||||
|
|
Loading…
Reference in a new issue