fix jsMath in catalog

This commit is contained in:
ccd0 2014-09-19 00:23:56 -07:00
parent 9dd83dcb1f
commit d70c7c0e51
2 changed files with 7 additions and 3 deletions

View File

@ -12,4 +12,5 @@ class CatalogThread
postCount: $ '.post-count', root
fileCount: $ '.file-count', root
pageCount: $ '.page-count', root
comment: $ '.comment', root
@thread.catalogView = @

View File

@ -21,7 +21,7 @@ Fourchan =
if (!jsMath) return;
if (jsMath.loaded) {
// process one post
jsMath.ProcessBeforeShowing(document.getElementById(e.detail));
jsMath.ProcessBeforeShowing(e.target);
} else if (jsMath.Autoload && jsMath.Autoload.checked) {
// load jsMath and process whole document
jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]);
@ -32,6 +32,9 @@ Fourchan =
Post.callbacks.push
name: 'Parse /sci/ math'
cb: @math
CatalogThread.callbacks.push
name: 'Parse /sci/ math'
cb: @math
code: ->
return if @isClone
apply = (e) ->
@ -44,8 +47,8 @@ Fourchan =
return
math: ->
return if (@isClone and doc.contains @origin.nodes.root) or !$ '.math', @nodes.comment
$.asap (=> doc.contains @nodes.post), =>
$.event 'jsmath', @nodes.post.id, window
$.asap (=> doc.contains @nodes.comment), =>
$.event 'jsmath', null, @nodes.comment
parseThread: (threadID, offset, limit) ->
# Fix /sci/
# Fix /g/