From 1db3c009734a5dcf0e0bdcea92041b5d1280cd1a Mon Sep 17 00:00:00 2001
From: Albert Graef <aggraef@gmail.com>
Date: Thu, 20 Oct 2016 17:23:33 +0200
Subject: [PATCH] If the search term is empty then just redisplay the toc.

---
 pd/nw/dialog_search.html | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pd/nw/dialog_search.html b/pd/nw/dialog_search.html
index 87fb9ec96..f043d72ba 100644
--- a/pd/nw/dialog_search.html
+++ b/pd/nw/dialog_search.html
@@ -451,6 +451,12 @@ function doc_search() {
         results,
         doc,
         i;
+    // if the search term is empty then just redisplay the toc
+    if (!search_text) {
+        clear_results();
+        display_toc();
+        return;
+    }
     // if the search term is doc/* short circuit the search and
     // just list the docs in that directory
     if (search_text.slice(0, 4) === "doc/" &&
-- 
GitLab