about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-04-28 09:58:59 +0000
committerbors <bors@rust-lang.org>2019-04-28 09:58:59 +0000
commit3418d2f50867b2c179be4239aedfffef9a650d5f (patch)
tree9b1cc210a95db8047060ec54d831e539a531aade /src
parent5f0dc0e1ffb10ff9277aacae9bff3e70d342c1d4 (diff)
parentb6cfcd363bcc700197da504f345afc394f9fc7f3 (diff)
downloadrust-3418d2f50867b2c179be4239aedfffef9a650d5f.tar.gz
rust-3418d2f50867b2c179be4239aedfffef9a650d5f.zip
Auto merge of #60346 - dima74:patch-1, r=GuillaumeGomez
Fix default value for setting "Auto-hide item methods' documentation"

If I open any documentation page in incognito mode (for example [for `Option` enum](https://doc.rust-lang.org/nightly/std/option/enum.Option.html)), then methods will be collapsed, though [on the settings page](https://doc.rust-lang.org/nightly/settings.html) there will be displayed that "Auto-hide item methods' documentation" option is disabled.

If I understand correctly, property "Auto-hide item methods' documentation" [should be disabled by default](https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/render.rs#L1969), so correct check would be `property === "true"`. This is consistent with other options:

Options which are enabled by default are compared to `"false"`

https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/render.rs#L1965-L1968

https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L2238
https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L2321
https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L2070

Options which are disabled by default are compared to `"true"`

https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/render.rs#L1970-L1972

https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L1389
https://github.com/rust-lang/rust/blob/938d4ffe16c4430e1dcede570b06227114cb73d5/src/librustdoc/html/static/main.js#L2334
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/main.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 00ca78b749e..85ab0855f05 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -2105,7 +2105,7 @@ if (!DOMTokenList.prototype.remove) {
     }
 
     var toggle = createSimpleToggle(false);
-    var hideMethodDocs = getCurrentValue("rustdoc-method-docs") !== "false";
+    var hideMethodDocs = getCurrentValue("rustdoc-method-docs") === "true";
     var pageId = getPageId();
 
     var func = function(e) {