From 47836913cf40db4664241806e18dd33e23a28478 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 7 Aug 2015 21:08:46 +0500 Subject: [PATCH] fix postPreview summoning --- js/interface_common.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index ee8e95f..e2ec064 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -573,7 +573,7 @@ function composeNewPost(e, postAreaNew) { var textArea = postAreaNew.find('textarea'); if (textArea.attr('data-reply-to') && !textArea.val().length) { textArea.val(textArea.attr('data-reply-to')); - posPostPreview(e); + posPostPreview(textArea); } if (!postAreaNew.find('textarea:focus').length) postAreaNew.find('textarea:last').focus(); @@ -583,7 +583,11 @@ function posPostPreview(event) { if (!$.Options.postPreview.val) return; - var textArea = $(event.target); + if (event.jquery) { + var textArea = event; + } else { + var textArea = $(event.target); + } var postPreview = textArea.siblings('#post-preview'); if (!postPreview.length) { postPreview = $('#post-preview-template').children().clone()