Skip to content

Commit

Permalink
Fix details not being unrolled when clicking on summary in Chrome (#181)
Browse files Browse the repository at this point in the history
Chrome does not treat <a> tags inside a <summary> tag the same way as Firefox, such that the details tag will not unroll when the summary is clicked. This commit swaps the <a> tags for a custom tag <clickme> that colours the summaries like links, without being links. Chrome now acts as expected.

Couple of other small fixes to docstrings were included.
  • Loading branch information
H0R5E authored Sep 22, 2020
1 parent 7ad8d74 commit 7877bae
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
10 changes: 8 additions & 2 deletions docs/_static/theme_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@
}

li {
text-align:left;
text-align:left;
}

body {
text-align:justify;
text-align:justify;
}

clickme {
color: #2980b9;
text-decoration: none;
cursor: pointer;
}
6 changes: 3 additions & 3 deletions docs/user/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Designing the device

.. raw:: html

<details><summary><a>See the entire file</a></summary></br>
<details><summary><clickme>See the entire file</clickme></summary></br>

.. literalinclude:: /../examples/WaveBot/designDevice.m
:language: matlab
Expand All @@ -56,7 +56,7 @@ Simulating device response

.. raw:: html

<details><summary><a>See the entire file</a></summary></br>
<details><summary><clickme>See the entire file</clickme></summary></br>

.. literalinclude:: /../examples/WaveBot/simulateDevice.m
:language: matlab
Expand Down Expand Up @@ -89,7 +89,7 @@ Reporting results

.. raw:: html

<details><summary><a>See the entire file</a></summary></br>
<details><summary><clickme>See the entire file</clickme></summary></br>

.. literalinclude:: /../examples/WaveBot/Performance.m
:language: matlab
Expand Down
2 changes: 1 addition & 1 deletion docs/user/optimization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ example considers the DOE Reference Model 3 (RM3_) device.

.. raw:: html

<details><summary><a>See the entire example file</a></summary></br>
<details><summary><clickme>See the entire example file</clickme></summary></br>

.. literalinclude:: /../examples/RM3/optimization.m
:language: matlab
Expand Down
8 changes: 4 additions & 4 deletions docs/user/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Download

.. raw:: html

<details><summary><a>Get the stable version</a></summary></br>
<details><summary><clickme>Get the stable version</clickme></summary></br>

The latest stable version of WecOptTool can be downloaded by clicking `HERE <https://github.com/SNL-WaterPower/WecOptTool/archive/v1.0.0.zip>`__.

Expand All @@ -55,7 +55,7 @@ Details of this and previous stable releases can be found in the `Releases <http

.. raw:: html

<details><summary><a>Get the development version</a></summary></br>
<details><summary><clickme>Get the development version</clickme></summary></br>

To get the latest development version of WecOptTool, clone or download the WecOptTool GitHub repository using the '`Clone or download <https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository>`__' button.

Expand Down Expand Up @@ -90,7 +90,7 @@ Install

.. raw:: html

<details><summary><a>Windows</a></summary></br>
<details><summary><clickme>Windows</clickme></summary></br>

Executables are provided in the ‘Release’ directory of the NEMOH source code.
These are installed into WecOptTool using the ``installNemoh.m`` MATLAB script, run from the WecOptTool root directory, using the MATLAB command prompt as follows:
Expand All @@ -106,7 +106,7 @@ Install

.. raw:: html

<details><summary><a>Linux</a></summary></br>
<details><summary><clickme>Linux</clickme></summary></br>

To set up NEMOH for Linux, first, use a command window to compile the executables (you will need gfortran or the Intel FORTRAN compiler):

Expand Down
2 changes: 1 addition & 1 deletion toolbox/+WecOptTool/AutoFolder.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
classdef AutoFolder < WecOptTool.base.TempFolder
% Class that creates a unique temporary folders, which are deleted
% Class that creates unique temporary folders, which are deleted
% upon object destruction.
%
% Attributes:
Expand Down
4 changes: 0 additions & 4 deletions toolbox/+WecOptTool/SeaState.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
%
% * mu
%
% Once created, the parameters in the object are read only, but the
% object can be converted to a struct, and then modified.
%
% Arguments:
% S (struct):
% A struct containing the required fields, validated by the
Expand Down Expand Up @@ -96,7 +93,6 @@
% getAmplitudeSpectrum - return wave amplitude per angular frequency
% plot - plot spectra with comparison to base spectra, if different
% validateArray - object array validation
% struct - convert to struct
% checkSpectrum - validate a struct array representing spectra
% getSpecificEnergy - calculate the specific energy of spectra
% struct array
Expand Down

0 comments on commit 7877bae

Please sign in to comment.