mirror of
https://github.com/fverdugo/XM_40017.git
synced 2025-12-30 10:48:31 +01:00
build based on bf45227
This commit is contained in:
@@ -75,60 +75,75 @@ $(document).ready(function() {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
require(['jquery'], function($) {
|
||||
|
||||
let timer = 0;
|
||||
var isExpanded = true;
|
||||
|
||||
$(document).on("click", ".docstring header", function () {
|
||||
let articleToggleTitle = "Expand docstring";
|
||||
|
||||
if ($(this).siblings("section").is(":visible")) {
|
||||
debounce(() => {
|
||||
if ($(this).siblings("section").is(":visible")) {
|
||||
$(this)
|
||||
.find(".docstring-article-toggle-button")
|
||||
.removeClass("fa-chevron-down")
|
||||
.addClass("fa-chevron-right");
|
||||
} else {
|
||||
$(this)
|
||||
.find(".docstring-article-toggle-button")
|
||||
.removeClass("fa-chevron-right")
|
||||
.addClass("fa-chevron-down");
|
||||
|
||||
articleToggleTitle = "Collapse docstring";
|
||||
}
|
||||
|
||||
$(this)
|
||||
.find(".docstring-article-toggle-button")
|
||||
.removeClass("fa-chevron-down")
|
||||
.addClass("fa-chevron-right");
|
||||
} else {
|
||||
$(this)
|
||||
.find(".docstring-article-toggle-button")
|
||||
.removeClass("fa-chevron-right")
|
||||
.addClass("fa-chevron-down");
|
||||
|
||||
articleToggleTitle = "Collapse docstring";
|
||||
}
|
||||
|
||||
$(this)
|
||||
.find(".docstring-article-toggle-button")
|
||||
.prop("title", articleToggleTitle);
|
||||
$(this).siblings("section").slideToggle();
|
||||
.prop("title", articleToggleTitle);
|
||||
$(this).siblings("section").slideToggle();
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on("click", ".docs-article-toggle-button", function () {
|
||||
let articleToggleTitle = "Expand docstring";
|
||||
let navArticleToggleTitle = "Expand all docstrings";
|
||||
|
||||
if (isExpanded) {
|
||||
$(this).removeClass("fa-chevron-up").addClass("fa-chevron-down");
|
||||
$(".docstring-article-toggle-button")
|
||||
.removeClass("fa-chevron-down")
|
||||
.addClass("fa-chevron-right");
|
||||
debounce(() => {
|
||||
if (isExpanded) {
|
||||
$(this).removeClass("fa-chevron-up").addClass("fa-chevron-down");
|
||||
$(".docstring-article-toggle-button")
|
||||
.removeClass("fa-chevron-down")
|
||||
.addClass("fa-chevron-right");
|
||||
|
||||
isExpanded = false;
|
||||
isExpanded = false;
|
||||
|
||||
$(".docstring section").slideUp();
|
||||
} else {
|
||||
$(this).removeClass("fa-chevron-down").addClass("fa-chevron-up");
|
||||
$(".docstring-article-toggle-button")
|
||||
.removeClass("fa-chevron-right")
|
||||
.addClass("fa-chevron-down");
|
||||
$(".docstring section").slideUp();
|
||||
} else {
|
||||
$(this).removeClass("fa-chevron-down").addClass("fa-chevron-up");
|
||||
$(".docstring-article-toggle-button")
|
||||
.removeClass("fa-chevron-right")
|
||||
.addClass("fa-chevron-down");
|
||||
|
||||
isExpanded = true;
|
||||
articleToggleTitle = "Collapse docstring";
|
||||
navArticleToggleTitle = "Collapse all docstrings";
|
||||
isExpanded = true;
|
||||
articleToggleTitle = "Collapse docstring";
|
||||
navArticleToggleTitle = "Collapse all docstrings";
|
||||
|
||||
$(".docstring section").slideDown();
|
||||
$(".docstring section").slideDown();
|
||||
}
|
||||
|
||||
$(this).prop("title", navArticleToggleTitle);
|
||||
$(".docstring-article-toggle-button").prop("title", articleToggleTitle);
|
||||
});
|
||||
});
|
||||
|
||||
function debounce(callback, timeout = 300) {
|
||||
if (Date.now() - timer > timeout) {
|
||||
callback();
|
||||
}
|
||||
|
||||
$(this).prop("title", navArticleToggleTitle);
|
||||
$(".docstring-article-toggle-button").prop("title", articleToggleTitle);
|
||||
});
|
||||
clearTimeout(timer);
|
||||
|
||||
timer = Date.now();
|
||||
}
|
||||
|
||||
})
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -6,4 +6,4 @@
|
||||
Website: https://highlightjs.org/
|
||||
License: see project LICENSE
|
||||
Touched: 2021
|
||||
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#F3F3F3;color:#444}.hljs-comment{color:#697070}.hljs-tag,.hljs-punctuation{color:#444a}.hljs-tag .hljs-name,.hljs-tag .hljs-attr{color:#444}.hljs-keyword,.hljs-attribute,.hljs-selector-tag,.hljs-meta .hljs-keyword,.hljs-doctag,.hljs-name{font-weight:bold}.hljs-type,.hljs-string,.hljs-number,.hljs-selector-id,.hljs-selector-class,.hljs-quote,.hljs-template-tag,.hljs-deletion{color:#880000}.hljs-title,.hljs-section{color:#880000;font-weight:bold}.hljs-regexp,.hljs-symbol,.hljs-variable,.hljs-template-variable,.hljs-link,.hljs-selector-attr,.hljs-operator,.hljs-selector-pseudo{color:#ab5656}.hljs-literal{color:#695}.hljs-built_in,.hljs-bullet,.hljs-code,.hljs-addition{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}
|
||||
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#F3F3F3;color:#444}.hljs-comment{color:#697070}.hljs-tag,.hljs-punctuation{color:#444a}.hljs-tag .hljs-name,.hljs-tag .hljs-attr{color:#444}.hljs-keyword,.hljs-attribute,.hljs-selector-tag,.hljs-meta .hljs-keyword,.hljs-doctag,.hljs-name{font-weight:bold}.hljs-type,.hljs-string,.hljs-number,.hljs-selector-id,.hljs-selector-class,.hljs-quote,.hljs-template-tag,.hljs-deletion{color:#880000}.hljs-title,.hljs-section{color:#880000;font-weight:bold}.hljs-regexp,.hljs-symbol,.hljs-variable,.hljs-template-variable,.hljs-link,.hljs-selector-attr,.hljs-operator,.hljs-selector-pseudo{color:#ab5656}.hljs-literal{color:#695}.hljs-built_in,.hljs-bullet,.hljs-code,.hljs-addition{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}.gap-4{gap:1rem}
|
||||
|
||||
Reference in New Issue
Block a user