From 1442ca16b410d327d7ec6269944144dfa075ff17 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sun, 8 Mar 2015 12:54:08 +0100 Subject: [PATCH] Some reply buttons wouldn't work the first time they were clicked. --- js/util.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/util.js b/js/util.js index e6806ce538..cee238836a 100644 --- a/js/util.js +++ b/js/util.js @@ -659,6 +659,12 @@ var SN = { // StatusNet if (list.length == 0) { list = notice.closest('.threaded-replies'); } + if (list.length == 0) { + list = $(''); + notice.append(list); + list = notice.find('.threaded-replies'); + } + var nextStep = function () { // Override...? replyForm.find('input[name=inreplyto]').val(id); @@ -701,10 +707,10 @@ var SN = { // StatusNet data: {ajax: 1, inreplyto: id}, success: function (data, textStatus, xhr) { var formEl = document._importNode($('form', data)[0], true); - replyItem.append(formEl); + replyForm = $(formEl); + replyItem.append(replyForm); list.append(replyItem); - replyForm = $(formEl); SN.Init.NoticeFormSetup(replyForm); nextStep(); },