$.off these 4chanXInitFinished.
This commit is contained in:
parent
a5deb20196
commit
cf1d94876a
@ -8,7 +8,10 @@ class DataBoard
|
|||||||
return unless sync
|
return unless sync
|
||||||
# Chrome also fires the onChanged callback on the current tab,
|
# Chrome also fires the onChanged callback on the current tab,
|
||||||
# so we only start syncing when we're ready.
|
# so we only start syncing when we're ready.
|
||||||
$.on d, '4chanXInitFinished', => @sync = sync
|
init = =>
|
||||||
|
$.off d, '4chanXInitFinished', init
|
||||||
|
@sync = sync
|
||||||
|
$.on d, '4chanXInitFinished', init
|
||||||
|
|
||||||
delete: ({boardID, threadID, postID}) ->
|
delete: ({boardID, threadID, postID}) ->
|
||||||
if postID
|
if postID
|
||||||
|
|||||||
@ -297,6 +297,7 @@ Settings =
|
|||||||
localStorage.setItem '4chan-settings', JSON.stringify settings
|
localStorage.setItem '4chan-settings', JSON.stringify settings
|
||||||
|
|
||||||
open: (openSection) ->
|
open: (openSection) ->
|
||||||
|
$.off d, '4chanXInitFinished', Settings.open
|
||||||
return if Settings.dialog
|
return if Settings.dialog
|
||||||
$.event 'CloseMenu'
|
$.event 'CloseMenu'
|
||||||
|
|
||||||
@ -1778,11 +1779,13 @@ Keybinds =
|
|||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW is 'catalog' or !Conf['Keybinds']
|
return if g.VIEW is 'catalog' or !Conf['Keybinds']
|
||||||
|
|
||||||
$.on d, '4chanXInitFinished', ->
|
init = ->
|
||||||
|
$.off d, '4chanXInitFinished', init
|
||||||
$.on d, 'keydown', Keybinds.keydown
|
$.on d, 'keydown', Keybinds.keydown
|
||||||
for node in $$ '[accesskey]'
|
for node in $$ '[accesskey]'
|
||||||
node.removeAttribute 'accesskey'
|
node.removeAttribute 'accesskey'
|
||||||
return
|
return
|
||||||
|
$.on d, '4chanXInitFinished', init
|
||||||
|
|
||||||
keydown: (e) ->
|
keydown: (e) ->
|
||||||
return unless key = Keybinds.keyCode e
|
return unless key = Keybinds.keyCode e
|
||||||
@ -1999,7 +2002,10 @@ Nav =
|
|||||||
$.on next, 'click', @next
|
$.on next, 'click', @next
|
||||||
|
|
||||||
$.add span, [prev, $.tn(' '), next]
|
$.add span, [prev, $.tn(' '), next]
|
||||||
$.on d, '4chanXInitFinished', -> $.add d.body, span
|
append = ->
|
||||||
|
$.off d, '4chanXInitFinished', append
|
||||||
|
$.add d.body, span
|
||||||
|
$.on d, '4chanXInitFinished', append
|
||||||
|
|
||||||
prev: ->
|
prev: ->
|
||||||
if g.VIEW is 'thread'
|
if g.VIEW is 'thread'
|
||||||
@ -4259,6 +4265,7 @@ ThreadWatcher =
|
|||||||
$.delete 'AutoWatch'
|
$.delete 'AutoWatch'
|
||||||
|
|
||||||
ready: ->
|
ready: ->
|
||||||
|
$.off d, '4chanXInitFinished', ThreadWatcher.ready
|
||||||
return unless Main.isThisPageLegit()
|
return unless Main.isThisPageLegit()
|
||||||
ThreadWatcher.refresh()
|
ThreadWatcher.refresh()
|
||||||
$.add d.body, ThreadWatcher.dialog
|
$.add d.body, ThreadWatcher.dialog
|
||||||
|
|||||||
@ -14,6 +14,7 @@ QR =
|
|||||||
cb: @node
|
cb: @node
|
||||||
|
|
||||||
initReady: ->
|
initReady: ->
|
||||||
|
$.off d, '4chanXInitFinished', QR.initReady
|
||||||
QR.postingIsEnabled = !!$.id 'postForm'
|
QR.postingIsEnabled = !!$.id 'postForm'
|
||||||
return unless QR.postingIsEnabled
|
return unless QR.postingIsEnabled
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user