results.webkit.org: Fix prepending search result on empty list
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Sep 2019 23:03:32 +0000 (23:03 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Sep 2019 23:03:32 +0000 (23:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201512

Reviewed by Aakash Jain.

* resultsdbpy/resultsdbpy/view/templates/search.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249549 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/resultsdbpy/resultsdbpy/view/templates/search.html

index ae8e141..b4a14dd 100644 (file)
@@ -1,5 +1,14 @@
 2019-09-05  Jonathan Bedard  <jbedard@apple.com>
 
+        results.webkit.org: Fix prepending search result on empty list 
+        https://bugs.webkit.org/show_bug.cgi?id=201512
+
+        Reviewed by Aakash Jain.
+
+        * resultsdbpy/resultsdbpy/view/templates/search.html:
+
+2019-09-05  Jonathan Bedard  <jbedard@apple.com>
+
         results.webkit.org: Retain certain parameters when following menu links
         https://bugs.webkit.org/show_bug.cgi?id=201463
 
index fa3aa43..6fc4c31 100644 (file)
@@ -131,7 +131,10 @@ class SearchView {
                     DOM.inject(element, diff.children.map(renderChild).join(''));
                 if (diff.prepending) {
                     diff.prepending.forEach(child => {
-                        DOM.after(element.firstElementChild, renderChild(child));
+                        if (element.firstElementChild)
+                            DOM.after(element.firstElementChild, renderChild(child));
+                        else
+                            DOM.inject(element, renderChild(child));
                         this.ref.state.children.unshift(child);
                     });
                 }