The refresh button behavior should be dependent on the view

This commit is contained in:
Zixaphir 2014-01-10 20:18:04 -07:00
parent b5f357bcfe
commit 55453f02e4
3 changed files with 18 additions and 3 deletions

View File

@ -2160,7 +2160,7 @@
}
this.button = $.el('a', {
className: 'index-refresh-shortcut fa fa-refresh',
title: 'Refresh Index',
title: 'Refresh',
href: 'javascript:;',
textContent: 'Refresh Index'
});
@ -2449,6 +2449,12 @@
if (!navigator.onLine) {
return;
}
if (g.VIEW === 'thread') {
if (Conf['Thread Updater']) {
return ThreadUpdater.update();
}
return;
}
if (!(d.readyState === 'loading' || Index.root.parentElement)) {
$.replace($('.board'), Index.root);
}

View File

@ -2170,7 +2170,7 @@
}
this.button = $.el('a', {
className: 'index-refresh-shortcut fa fa-refresh',
title: 'Refresh Index',
title: 'Refresh',
href: 'javascript:;',
textContent: 'Refresh Index'
});
@ -2459,6 +2459,12 @@
if (!navigator.onLine) {
return;
}
if (g.VIEW === 'thread') {
if (Conf['Thread Updater']) {
return ThreadUpdater.update();
}
return;
}
if (!(d.readyState === 'loading' || Index.root.parentElement)) {
$.replace($('.board'), Index.root);
}

View File

@ -4,7 +4,7 @@ Index =
@button = $.el 'a',
className: 'index-refresh-shortcut fa fa-refresh'
title: 'Refresh Index'
title: 'Refresh'
href: 'javascript:;'
textContent: 'Refresh Index'
$.on @button, 'click', @update
@ -203,6 +203,9 @@ Index =
update: (pageNum) ->
return unless navigator.onLine
if g.VIEW is 'thread'
return ThreadUpdater.update() if Conf['Thread Updater']
return
unless d.readyState is 'loading' or Index.root.parentElement
$.replace $('.board'), Index.root
Index.req?.abort()