summaryrefslogtreecommitdiff
path: root/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
diff options
context:
space:
mode:
authorAntoine Gourlay <antoine@gourlay.fr>2015-09-09 16:32:30 +0200
committerAntoine Gourlay <antoine@gourlay.fr>2015-09-15 16:08:39 +0200
commitdaf557a567e99521829618a11237d4d987122d5f (patch)
tree328248be5d1fccca4a7395dd62ee9c9bab8a5e79 /src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
parent7d91f64c5be62a5526dac59f37003b73181cd915 (diff)
downloadscala-daf557a567e99521829618a11237d4d987122d5f.tar.gz
scala-daf557a567e99521829618a11237d4d987122d5f.tar.bz2
scala-daf557a567e99521829618a11237d4d987122d5f.zip
SI-9429 fix filtering in scaladoc after focusing on a package
The scaladoc left pane used to be refreshed too often until ce5cfd2 when it was changed to only refresh when the filter changed. This forgot one important case when it also must be refreshed: when entering the "focus on a single package" mode (and it has been broken ever since). This forces a refresh when focusing on a package, and makes sure all entities are displayed when filtering.
Diffstat (limited to 'src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js')
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
index 3d9cf8d465..cf81f7fdf5 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
+++ b/src/scaladoc/scala/tools/nsc/doc/html/resource/lib/index.js
@@ -412,7 +412,17 @@ function textFilter() {
var query = $("#textfilter input").attr("value") || '';
var queryRegExp = compilePattern(query);
- if ((typeof textFilter.lastQuery === "undefined") || (textFilter.lastQuery !== query)) {
+ // if we are filtering on types, then we have to display types
+ // ("display packages only" is not possible when filtering)
+ if (query !== "") {
+ kindFilter("all");
+ }
+
+ // Three things trigger a reload of the left pane list:
+ // typeof textFilter.lastQuery === "undefined" <-- first load, there is nothing yet in the left pane
+ // textFilter.lastQuery !== query <-- the filter text has changed
+ // focusFilterState != null <-- a package has been "focused"
+ if ((typeof textFilter.lastQuery === "undefined") || (textFilter.lastQuery !== query) || (focusFilterState != null)) {
textFilter.lastQuery = query;