diff options
| author | Rory O’Kane <rory@roryokane.com> | 2015-05-07 03:53:21 -0400 |
|---|---|---|
| committer | Rory O’Kane <rory@roryokane.com> | 2015-05-07 04:11:14 -0400 |
| commit | 92565b3dfbacca4b2a851758e5e9a784fc5b156e (patch) | |
| tree | 113605fb3cb19afd9e09845d1041377bbfff360f /src/libstd | |
| parent | 6ce05ae6bb0e5762dee940d043feb728e5583564 (diff) | |
| download | rust-92565b3dfbacca4b2a851758e5e9a784fc5b156e.tar.gz rust-92565b3dfbacca4b2a851758e5e9a784fc5b156e.zip | |
Refactor doc toggle button label changing
To separate concerns, instead of checking the state of `#toggle-all-docs` by looking at its label text, I add or remove a class `will-expand` depending on whether the button’s next click will expand everything. (The `if` statement’s two branches were swapped as part of this change.) I moved the desired text values to a function `labelForToggleButton`, so changing the values will be easier. I also note in a comment the other file where the text is duplicated. To allow the labels of both types of toggle buttons to be uniformly set, I added a `span.inner` to the global button too. I split the template in `render.rs` into multiple lines to make room for the `span`, and that adds whitespace around the `[` and `]` text elements. That seems to be okay, though – the page still looks the same. I updated the CSS styling for `.collapse-toggle > .inner` to add a little extra space around the symbol, to make minus signs easier to identify. (`#toggle-all-docs > .inner` does not need the same style, since its text size is bigger, so it naturally puts more space around the symbol.)
Diffstat (limited to 'src/libstd')
0 files changed, 0 insertions, 0 deletions
