Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions layouts/shortcodes/accordion-options.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@

Usage:
-------
{{< accordion-options threshold="600" notCollapsible="false" >}}
{{< accordion-options collapsible="false" >}}
Code block content goes here with **markdown** support.
{{< /accordion-options >}}

{{< accordion-options threshold="600" >}}
Code block content goes here with **markdown** support.
{{< /accordion-options >}}

Parameters:
------------
-- threshold (number): The pixel threshold at which the accordion collapses (only for non-collapsible accordions)
-- notCollapsible (boolean): If true, the accordion cannot be collapsed
-- collapsible (boolean): Default is true, if false then the accordion cannot be collapsed

*/}}

{{ $threshold := .Get "threshold" }}
{{ $notCollapsible := eq (lower (printf "%v" (.Get "notCollapsible"))) "true" }}
{{ $collapsible := ne (lower (printf "%v" (.Get "collapsible"))) "false" }}

<div class="accordion-options{{ if $notCollapsible }} accordion-options--not-collapsible{{ end }}" {{ if and $threshold (not $notCollapsible) }}data-threshold="{{ $threshold }}"{{ end }}>
<div class="accordion-options{{ if eq $collapsible false }} accordion-options--not-collapsible{{ end }}" {{ if and $threshold $collapsible }}data-threshold="{{ $threshold }}"{{ end }}>
{{ .Inner | markdownify }}
</div>
25 changes: 24 additions & 1 deletion static/js/content-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

(function ($) {
$(document).ready(function () {
// Code needed to load the hidden content blocks for the prism-accessibility.js to apply to the code blocks in them
$(".gd-docs-content__block").each(function(index) {
if (index > 0) {
$(this).css({
"display": "block",
"position": "absolute",
"opacity": 0,
});
}
});

setTimeout(function() {
$(".gd-docs-content__block").each(function(index) {
if (index > 0) {
$(this).css({
"display": "",
"position": "",
"opacity": "",
});
}
});
}, 100);

// Set up tab click behavior
$(".gd-docs-content-select__tab").on("click", setActive);

Expand Down Expand Up @@ -67,4 +90,4 @@
break;
}
};
}(jQuery));
}(jQuery));