]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Dynamic notice item insertion for conversation page.
authorSarven Capadisli <csarven@controlyourself.ca>
Sat, 13 Jun 2009 04:53:23 +0000 (00:53 -0400)
committerSarven Capadisli <csarven@controlyourself.ca>
Sat, 13 Jun 2009 04:53:23 +0000 (00:53 -0400)
js/util.js

index 786b763eeecb599c2df1fa8f327396b951cad090..fd2500d44710a5552f2c5d00771589eb14b9dc08 100644 (file)
@@ -203,10 +203,20 @@ $(document).ready(function(){
                                                     else {
                                                          li = $("li", xml).get(0);
                                                          if ($("#"+li.id).length == 0) {
-                                                              $("#notices_primary .notices").prepend(document._importNode(li, true));
-                                                              $("#notices_primary .notice:first").css({display:"none"});
-                                                              $("#notices_primary .notice:first").fadeIn(2500);
-                                                              NoticeReply();
+                                                            var notice_irt_value = $('#notice_in-reply-to').val();
+                                                            var notice_irt = '#notices_primary #notice-'+notice_irt_value;
+                                                            if($('body')[0].id == 'conversation') {
+                                                                if(notice_irt_value.length > 0 && $(notice_irt+' .notices').length < 1) {
+                                                                    $(notice_irt).append('<ul class="notices"></ul>');
+                                                                }
+                                                                $($(notice_irt+' .notices')[0]).append(document._importNode(li, true));
+                                                            }
+                                                            else {
+                                                                $("#notices_primary .notices").prepend(document._importNode(li, true));
+                                                            }
+                                                            $('#'+li.id).css({display:'none'});
+                                                            $('#'+li.id).fadeIn(2500);
+                                                            NoticeReply();
                                                          }
                                                                                                        }
                                                                                                        $("#notice_data-text").val("");
@@ -310,4 +320,3 @@ function NoticeAttachments() {
         }
     );
 }
-