diff --git a/index.js b/index.js index 721f7e0b..7bbdf0b0 100644 --- a/index.js +++ b/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(); });