use one random value for all resources, remove previous element before overwriting, does not get removed from dom otherwise.
This commit is contained in:
parent
ef0464edcc
commit
443a2fed9b
1 changed files with 5 additions and 3 deletions
8
index.js
8
index.js
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue