Switch document class names when switching between views

This commit is contained in:
Zixaphir 2014-01-09 14:49:05 -07:00
parent 259529b6dd
commit ab8607710b
6 changed files with 37 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -204,7 +204,7 @@ Index =
update: (pageNum) ->
return unless navigator.onLine
unless d.readyState is 'loading' or Index.root.parentElement
$.replace $ '.board', Index.root
$.replace $('.board'), Index.root
Index.req?.abort()
Index.notice?.close()

View File

@ -356,6 +356,11 @@ Main =
return
updateContext: (view) ->
$.rmClass doc, g.VIEW
$.addClass doc, view
g.VIEW = view
navigate: (e) ->
return if @hostname isnt 'boards.4chan.org' or window.location.hostname is 'rs.4chan.org'
@ -376,7 +381,7 @@ Main =
if view isnt g.VIEW
Main.disconnect()
Main.clean()
g.VIEW = view
Main.updateContext view
if view is 'index'
Main.updateBoard boardID unless boardID is g.BOARD.ID

View File

@ -486,7 +486,17 @@ div.center:not(.ad-cnt) {
.summary {
text-decoration: none;
}
.thread #index-last-refresh,
.thread #index-search-clear,
.thread #index-search {
display: none;
}
#index-last-refresh::before {
content: '[';
}
#index-last-refresh::after {
content: ']';
}
/* Announcement Hiding */
:root.hide-announcement #globalMessage {

View File

@ -1,4 +1,4 @@
[<a href="./catalog">Catalog</a>]&nbsp;
[<time id="index-last-refresh" title="Last index refresh">...</time>]&nbsp;
<time id="index-last-refresh" title="Last index refresh">...</time>&nbsp;
<input type="search" id="index-search" class="field" placeholder="Search">
<a id="index-search-clear" href="javascript:;" title="Clear search">×</a>