From ab915b71155e1c2004c1134d1ab730283931c985 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Mon, 2 Apr 2018 23:26:51 +0200
Subject: [PATCH] Move accounts above hashtags in search results

---
 Resources/Scripts/code.js            | 11 +++++++++++
 Resources/Scripts/styles/browser.css |  5 +++++
 2 files changed, 16 insertions(+)

diff --git a/Resources/Scripts/code.js b/Resources/Scripts/code.js
index b64fe951..3a298782 100644
--- a/Resources/Scripts/code.js
+++ b/Resources/Scripts/code.js
@@ -1196,6 +1196,17 @@
     }
   });
   
+  //
+  // Block: Reorder search results to move accounts above hashtags.
+  //
+  onAppReady.push(function(){
+    let container = $(".js-search-in-popover");
+    let hashtags = $(".js-typeahead-topic-list", container);
+    
+    $(".js-typeahead-user-list", container).insertBefore(hashtags);
+    hashtags.addClass("list-divider");
+  });
+  
   //
   // Block: Make submitting search queries while holding Ctrl or middle-clicking the search icon open the search externally.
   //
diff --git a/Resources/Scripts/styles/browser.css b/Resources/Scripts/styles/browser.css
index 09b11818..565c5051 100644
--- a/Resources/Scripts/styles/browser.css
+++ b/Resources/Scripts/styles/browser.css
@@ -195,6 +195,11 @@ a[data-full-url] {
   color: #9f51cf !important;
 }
 
+.js-typeahead-user-list.is-hidden + .js-typeahead-topic-list {
+  /* hide custom search result divider when not needed */
+  border-top: none !important;
+}
+
 /***************************************/
 /* Replace 'Stay open' with a pin icon */
 /***************************************/