From feef0a25681f97813c434b06dca5c3c9fb1af6ff Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 11 May 2011 19:18:34 +0200 Subject: [PATCH] fix for the actual safari bug ('for i in arguments' doesn't work in safari) --- source/Ox.UI/js/Core/Ox.Container.js | 5 +---- source/Ox.js | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/Ox.UI/js/Core/Ox.Container.js b/source/Ox.UI/js/Core/Ox.Container.js index 02ea6ef4..0fd3b6c5 100644 --- a/source/Ox.UI/js/Core/Ox.Container.js +++ b/source/Ox.UI/js/Core/Ox.Container.js @@ -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; }; diff --git a/source/Ox.js b/source/Ox.js index c982ce01..0f315d30 100644 --- a/source/Ox.js +++ b/source/Ox.js @@ -444,6 +444,10 @@ Ox.forEach 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') {