reset location after DOMContentLoaded, before it would cause an error if executed too quickly, when JS is served from cache.

This commit is contained in:
jrburke 2010-12-09 14:31:19 -08:00
Родитель 2eafce0744
Коммит 4dc01f5f47
1 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -42,13 +42,6 @@ function (require, $, fn, rdapi, oauth, jig,
showNew = options.show === 'new',
domains;
//If new items should be shown, refresh the location bar,
//so further reloads of the page do not trigger showNew
if (showNew) {
delete options.show;
location.replace(location.href.split('#')[0] + '#' + url.objectToQuery(options));
}
domains = {
'twitter.com': {
type: 'twitter',
@ -181,6 +174,14 @@ function (require, $, fn, rdapi, oauth, jig,
);
$(function () {
//If new items should be shown, refresh the location bar,
//so further reloads of the page do not trigger showNew
if (showNew) {
delete options.show;
location.replace(location.href.split('#')[0] + '#' + url.objectToQuery(options));
}
var manageDom = $("#manage"),
settingsDom = $("#settings"),
pref, node;