about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/source-script.js
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-05-03 14:58:56 +0900
committerGitHub <noreply@github.com>2022-05-03 14:58:56 +0900
commit27d7615bb4f20cd3546bf98d7ad2f812d5dc4e3c (patch)
treefee4c92152fc9539f06c3f5d0a58115f3159e061 /src/librustdoc/html/static/js/source-script.js
parentc110cfa161aab391bd37c16a95b8330bfc7e54ce (diff)
parent73688e40216f72a57577b39acfb9180322a41362 (diff)
downloadrust-27d7615bb4f20cd3546bf98d7ad2f812d5dc4e3c.tar.gz
rust-27d7615bb4f20cd3546bf98d7ad2f812d5dc4e3c.zip
Rollup merge of #93097 - GuillaumeGomez:settings-js, r=jsha
Switch settings menu to full js

Since the settings can only be set when the JS is enabled, it's not really a problem. It also fixes a debate we had around the themes not being accessible easily before.

![Screenshot from 2022-01-19 23-06-59](https://user-images.githubusercontent.com/3050060/150221936-fd1a1e76-06b6-4416-a653-dbae111979ed.png)

You can test it [here](https://rustdoc.crud.net/imperio/settings-js/doc/foo/index.html).

r? ``@jsha``
Diffstat (limited to 'src/librustdoc/html/static/js/source-script.js')
-rw-r--r--src/librustdoc/html/static/js/source-script.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/js/source-script.js b/src/librustdoc/html/static/js/source-script.js
index c48a847665e..6aee0da69f8 100644
--- a/src/librustdoc/html/static/js/source-script.js
+++ b/src/librustdoc/html/static/js/source-script.js
@@ -6,7 +6,7 @@
 /* global search, sourcesIndex */
 
 // Local js definitions:
-/* global addClass, getCurrentValue, hasClass, onEachLazy, removeClass, searchState */
+/* global addClass, getCurrentValue, hasClass, onEachLazy, removeClass, browserSupportsHistoryApi */
 /* global updateLocalStorage */
 (function() {
 
@@ -195,7 +195,7 @@ const handleSourceHighlight = (function() {
     const set_fragment = function(name) {
         const x = window.scrollX,
             y = window.scrollY;
-        if (searchState.browserSupportsHistoryApi()) {
+        if (browserSupportsHistoryApi()) {
             history.replaceState(null, null, "#" + name);
             highlightSourceLines();
         } else {