Skip to content

Commit

Permalink
Merge pull request #478 from StackExchange/bkelly/modal-docs-fix
Browse files Browse the repository at this point in the history
Modal docs js helper corrections
  • Loading branch information
b-kelly authored Apr 6, 2020
2 parents 421b918 + 5ebfa62 commit b76fe9e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/product/components/modals.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,19 @@
</thead>
<tbody class="fs-caption">
<tr>
<th scope="row"><code class="stacks-code">Stacks.toggleModal</code></th>
<th scope="row"><code class="stacks-code">Stacks.showModal</code></th>
<td>
<code class="stacks-code">element</code>: the element the <code class="stacks-code">data-controller="s-modal"</code> attribute is on <br><br>
<code class="stacks-code">show</code>: whether to force show/hide the modal; toggles the modal if left undefined
</td>
<td>Helper to manually show an s-modal element via external JS</td>
</tr>
<tr>
<th scope="row"><code class="stacks-code">Stacks.hideModal</code></th>
<td>
<code class="stacks-code">element</code>: the element the <code class="stacks-code">data-controller="s-modal"</code> attribute is on <br><br>
</td>
<td>Helper to manually hide an s-modal element via external JS</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -302,7 +308,7 @@ <h1 class="s-modal--header" id="modal-title">…</h1>
<div class="stacks-preview _preview-none">
{% highlight javascript %}
document.querySelector(".js-modal-toggle").addEventListener("click", function(e) {
Stacks.toggleModal(document.querySelector("#modal-base"));
Stacks.showModal(document.querySelector("#modal-base"));
});
{% endhighlight %}
</div>
Expand Down

0 comments on commit b76fe9e

Please sign in to comment.