]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Some reply buttons wouldn't work the first time they were clicked.
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 8 Mar 2015 11:54:08 +0000 (12:54 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 8 Mar 2015 11:54:08 +0000 (12:54 +0100)
js/util.js

index e6806ce5386d1c9f93dfe77e4eb5b415355dd3ba..cee238836a3515d093174b8483c3db48f8b3aa65 100644 (file)
@@ -659,6 +659,12 @@ var SN = { // StatusNet
             if (list.length == 0) {
                 list = notice.closest('.threaded-replies');
             }
+            if (list.length == 0) {
+                list = $('<ul class="notices threaded-replies xoxo"></ul>');
+                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();
                     },