From a39070b4409357b055e13e772c036b7a359543e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Albert=20Gr=C3=A4f?= <aggraef@gmail.com>
Date: Sat, 4 Feb 2017 02:46:40 +0100
Subject: [PATCH] Fix up the nwworkingdir of the help browser's file browser
 (fixes #237).

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

diff --git a/pd/nw/dialog_search.html b/pd/nw/dialog_search.html
index b423bfbaf..53d8e74ab 100644
--- a/pd/nw/dialog_search.html
+++ b/pd/nw/dialog_search.html
@@ -516,6 +516,7 @@ function add_events() {
 }
 
 function register_window_id(id, attrs) {
+    var doc_path = path.join(pdgui.get_lib_dir(), "doc");
     translate_form();
     // Translate the placeholder for the search input:
     document.getElementById("search_text").placeholder =
@@ -526,7 +527,7 @@ function register_window_id(id, attrs) {
     document.getElementById("results").textContent = l("search.building_index");
     document.getElementById("search_text").disabled = true;
     document.getElementById("file_browser").setAttribute("nwworkingdir",
-        pdgui.get_gui_dir() + "/doc"); // Probably need a doc getter in pdgui
+        doc_path); // Probably need a doc getter in pdgui
     build_index();
 }
 
-- 
GitLab