Fix false detection of posts added by updater on Tinyboard as own posts.
This commit is contained in:
parent
b7cd785559
commit
5e0e4c0337
@ -6,8 +6,10 @@ Tinyboard =
|
||||
$.global ->
|
||||
{boardID, threadID} = document.currentScript.dataset
|
||||
threadID = +threadID
|
||||
window.$(document).on 'new_post', (e, post) ->
|
||||
postID = +post.id.match(/\d*$/)[0]
|
||||
form = document.querySelector 'form[name="post"]'
|
||||
window.$(document).ajaxComplete (event, request, settings) ->
|
||||
return unless settings.url is form.action
|
||||
return unless (postID = +request.responseJSON?.id)
|
||||
detail = {boardID, threadID, postID}
|
||||
event = new CustomEvent 'QRPostSuccessful', {bubbles: true, detail: detail}
|
||||
document.dispatchEvent event
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user