Refactor global batch section handling in JavaScript, enhance CSS for collapsible sections, and increment version code to 4.72.782

This commit refines the JavaScript functions for managing global batch sections, improving the retrieval of section bodies and ensuring proper toggling functionality. The CSS is updated to support collapsible sections, allowing for better organization of content. Additionally, the version code is incremented to 4.72.782 to reflect these changes.
This commit is contained in:
2026-07-09 12:23:11 -04:00
parent 2aa398b1f0
commit 4fefc8c053
3 changed files with 32 additions and 14 deletions

View File

@ -342,14 +342,28 @@
return document.getElementById('bib-global-batch');
}
function bibGetGlobalBatchExistingSection() {
/** Corps du panneau (dans #bib-tool-detail-body une fois l'outil ouvert). */
function bibGetGlobalBatchBody() {
var detailBody = document.getElementById('bib-tool-detail-body');
if (detailBody) {
var inDetail = detailBody.querySelector('.bib-global-batch__body');
if (inDetail) {
return inDetail;
}
}
var panel = bibGetGlobalBatchPanel();
return panel ? panel.querySelector('.bib-global-batch--existing') : null;
return panel ? panel.querySelector('.bib-global-batch__body') : null;
}
function bibGetGlobalBatchExistingSection() {
var body = bibGetGlobalBatchBody();
return body ? body.querySelector('.bib-global-batch--existing') : null;
}
function bibGetGlobalBatchGeneratedSection() {
var panel = bibGetGlobalBatchPanel();
return panel ? panel.querySelector('.bib-global-batch--generated') : null;
var body = bibGetGlobalBatchBody();
return body ? body.querySelector('.bib-global-batch--generated') : null;
}
function bibInvalidateGlobalBatchPanel() {
@ -1300,7 +1314,7 @@
existing.remove();
}
var anchor = bibGetGlobalBatchPanel();
var anchor = bibGetGlobalBatchBody() || bibGetGlobalBatchPanel();
if (anchor) {
anchor.insertAdjacentHTML('afterend', data.html);
}
@ -1346,7 +1360,7 @@
existing.remove();
}
var anchor = bibGetGlobalBatchPanel();
var anchor = bibGetGlobalBatchBody() || bibGetGlobalBatchPanel();
if (anchor) {
anchor.insertAdjacentHTML('afterend', data.html);
}
@ -1375,7 +1389,7 @@
return;
}
var bibGlobalBatchPanel = bibGetGlobalBatchPanel();
var bibGlobalBatchPanel = bibGetGlobalBatchBody();
if (!bibGlobalBatchPanel || !bibGlobalBatchPanel.contains(e.target)) {
return;
}
@ -1596,10 +1610,10 @@
}
var willExpand = section.classList.contains('is-collapsed');
var panel = bibGetGlobalBatchPanel();
var root = bibGetGlobalBatchBody();
if (willExpand && panel) {
panel.querySelectorAll('.bib-global-batch__section').forEach(function (other) {
if (willExpand && root) {
root.querySelectorAll('.bib-global-batch__section').forEach(function (other) {
if (other !== section) {
bibCollapseGlobalBatchSection(other);
}
@ -1651,8 +1665,7 @@
}
let globalBatchSection = btnToggle.closest('.bib-global-batch__section');
if (globalBatchSection && bibGetGlobalBatchPanel()
&& bibGetGlobalBatchPanel().contains(globalBatchSection)) {
if (globalBatchSection && moduleBib.contains(globalBatchSection)) {
e.preventDefault();
bibToggleGlobalBatchSection(globalBatchSection, btnToggle);
return;