From 63d7372ad2058df0d784eedb7db390d61de03238 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 18 Jun 2014 23:59:17 -0700 Subject: [PATCH] a few more tweaks from Mayhem --- src/General/lib/$.coffee | 2 +- src/Miscellaneous/Fourchan.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index 11a6c6d57..083ce408b 100755 --- a/src/General/lib/$.coffee +++ b/src/General/lib/$.coffee @@ -178,7 +178,7 @@ $.off = (el, events, handler) -> $.event = (event, detail, root=d) -> <% if (type === 'userscript') { %> - if typeof cloneInto is 'function' + if detail? and typeof cloneInto is 'function' detail = cloneInto detail, document.defaultView <% } %> root.dispatchEvent new CustomEvent event, {bubbles: true, detail} diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 982ec45d7..5d5159f51 100755 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -21,7 +21,7 @@ Fourchan = if (!jsMath) return; if (jsMath.loaded) { // process one post - jsMath.ProcessBeforeShowing(document.getElementById('p' + e.detail)); + jsMath.ProcessBeforeShowing(document.getElementById(e.detail)); } else if (jsMath.Autoload && jsMath.Autoload.checked) { // load jsMath and process whole document jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]); @@ -43,7 +43,7 @@ Fourchan = math: -> return if (@isClone and doc.contains @origin.nodes.root) or !$ '.math', @nodes.comment $.asap (=> doc.contains @nodes.post), => - $.event 'jsmath', @ID, window + $.event 'jsmath', @nodes.post.id, window parseThread: (threadID, offset, limit) -> # Fix /sci/ # Fix /g/