use one random value for all resources, remove previous element before overwriting, does not get removed from dom otherwise.

This commit is contained in:
j 2012-07-10 10:51:34 +02:00
parent ef0464edcc
commit 443a2fed9b

View file

@ -239,7 +239,7 @@ Ox.load(/^https?:\/\/(www\.)?oxjs\.org\//.test(
app.state.loaded = true;
},
loadData: function(callback) {
var q = '?' + Ox.random(1000000),
var q = '?' + salt,
url = '//oxjs.org/downloads/downloads.json' + q;
Ox.getJSON('index.json' + q, function(data) {
app.data = Ox.extend(app.data, data);
@ -529,6 +529,7 @@ Ox.load(/^https?:\/\/(www\.)?oxjs\.org\//.test(
panel: function() {
var $panel = Ox.TabPanel({
content: function(id) {
app.$ui[id] && app.$ui[id].remove();
return app.$ui[id] = app.ui[id]
? app.ui[id]() : app.ui.page(id);
},
@ -602,7 +603,7 @@ Ox.load(/^https?:\/\/(www\.)?oxjs\.org\//.test(
id && $panel.find('.item#' + id).addClass('selected');
Ox.get('readme/' + (
id || 'index/readme'
) + '.html?' + Math.random(1000000), function(html) {
) + '.html?' + salt, function(html) {
$text.empty()
.append(
id ? html
@ -720,6 +721,7 @@ Ox.load(/^https?:\/\/(www\.)?oxjs\.org\//.test(
}
},
user: {}
};
},
salt = /^https?:\/\/(www\.)?oxjs\.org\//.test(window.location.href) ? Ox.VERSION : +new Date;
app.init();
});