mirror of
https://github.com/eosswedenorg/apt
synced 2026-06-21 09:58:19 +02:00
_scripts/app.js: Adding collapse code
This commit is contained in:
parent
f4982b7669
commit
7a56cc4738
1 changed files with 15 additions and 1 deletions
|
|
@ -1,8 +1,22 @@
|
||||||
|
|
||||||
anchors.add();
|
anchors.add();
|
||||||
|
|
||||||
// adapted from https://stackoverflow.com/a/48078807/1217368
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
$('.collapse-trigger').click(function() {
|
||||||
|
|
||||||
|
var target_id = $(this).attr('data-target');
|
||||||
|
|
||||||
|
if (target_id) {
|
||||||
|
var target = $(document).find('#' + target_id);
|
||||||
|
|
||||||
|
$(target).toggleClass('collapsed');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// adapted from https://stackoverflow.com/a/48078807/1217368
|
||||||
$('.highlight > pre').each(function(i) {
|
$('.highlight > pre').each(function(i) {
|
||||||
if (!$(this).parent().hasClass('no-select-button')) {
|
if (!$(this).parent().hasClass('no-select-button')) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue