Update QR depending on state.

This commit is contained in:
Zixaphir 2014-01-09 23:20:38 -07:00
parent 79cf8713a4
commit 890277f296
5 changed files with 36 additions and 22 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

@ -105,9 +105,11 @@ Navigate =
switch view switch view
when 'index' when 'index'
QR.link.textContent = 'Start a Thread'
$.off d, 'ThreadUpdate', QR.statusCheck $.off d, 'ThreadUpdate', QR.statusCheck
$.on d, 'indexRefresh', QR.generatePostableThreadsList $.on d, 'indexRefresh', QR.generatePostableThreadsList
when 'thread' when 'thread'
QR.link.textContent = 'Reply to Thread'
$.on d, 'ThreadUpdate', QR.statusCheck $.on d, 'ThreadUpdate', QR.statusCheck
$.off d, 'IndexRefresh', QR.generatePostableThreadsList $.off d, 'IndexRefresh', QR.generatePostableThreadsList

View File

@ -765,7 +765,7 @@ a.hide-announcement {
:root.hide-original-post-form .postingMode, :root.hide-original-post-form .postingMode,
:root.hide-original-post-form #togglePostForm, :root.hide-original-post-form #togglePostForm,
#qr.autohide:not(.has-focus):not(:hover) > form, #qr.autohide:not(.has-focus):not(:hover) > form,
.postingMode ~ #qr select[data-name=thread], .thread #qr select[data-name=thread],
#file-n-submit:not(.has-file) #qr-filerm { #file-n-submit:not(.has-file) #qr-filerm {
display: none; display: none;
} }

View File

@ -45,6 +45,8 @@ QR =
link = $.el 'h1', link = $.el 'h1',
innerHTML: "<a href=javascript:; class='qr-link'>#{if g.VIEW is 'thread' then 'Reply to Thread' else 'Start a Thread'}</a>" innerHTML: "<a href=javascript:; class='qr-link'>#{if g.VIEW is 'thread' then 'Reply to Thread' else 'Start a Thread'}</a>"
className: "qr-link-container" className: "qr-link-container"
QR.link = link.firstElementChild
$.on link.firstChild, 'click', -> $.on link.firstChild, 'click', ->
$.event 'CloseMenu' $.event 'CloseMenu'
@ -70,11 +72,13 @@ QR =
when 'index' when 'index'
$.on d, 'IndexRefresh', QR.generatePostableThreadsList $.on d, 'IndexRefresh', QR.generatePostableThreadsList
when 'thread' when 'thread'
$.on d, 'ThreadUpdate', -> $.on d, 'ThreadUpdate', QR.statusCheck
if g.DEAD
QR.abort() statusCheck: ->
else if g.DEAD
QR.status() QR.abort()
else
QR.status()
node: -> node: ->
$.on $('a[title="Quote this post"]', @nodes.info), 'click', QR.quote $.on $('a[title="Quote this post"]', @nodes.info), 'click', QR.quote