Implement collapsible sections for global batch assignments, enhance styles, and increment version code to 4.72.781
This commit introduces collapsible sections for global batch assignments in the user interface, improving organization and user experience. The CSS is updated to style these sections, including headers and content areas, while the JavaScript is modified to handle the toggling functionality. Additionally, the version code is incremented to 4.72.781 to reflect these changes.
This commit is contained in:
@ -621,8 +621,7 @@
|
||||
}
|
||||
|
||||
if (toolId === 'global_batch') {
|
||||
updateGlobalBatchAnalysis();
|
||||
updateGlobalBatchGeneratedAnalysis();
|
||||
/* Sections repliées à l'arrivée — analyse au déploiement d'une section. */
|
||||
}
|
||||
|
||||
bibSyncToolNavBadges(toolId);
|
||||
@ -640,8 +639,7 @@
|
||||
initModuleBibTippy(document.getElementById('bib-tool-detail'));
|
||||
|
||||
if (toolId === 'global_batch') {
|
||||
updateGlobalBatchAnalysis();
|
||||
updateGlobalBatchGeneratedAnalysis();
|
||||
/* Sections repliées à l'arrivée — analyse au déploiement d'une section. */
|
||||
}
|
||||
}
|
||||
|
||||
@ -717,8 +715,6 @@
|
||||
body.classList.remove('bib-ui-hidden');
|
||||
}
|
||||
bibGlobalBatchSetToggleState(toggle, true);
|
||||
updateGlobalBatchAnalysis();
|
||||
updateGlobalBatchGeneratedAnalysis();
|
||||
}
|
||||
|
||||
function bibSetGlobalBatchInfo(infoEl, text, state) {
|
||||
@ -1558,7 +1554,8 @@
|
||||
}
|
||||
let collapsed = block.classList.toggle('is-collapsed');
|
||||
btnToggle.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
|
||||
let hdr = block.querySelector('.bib-anomaly-block-header');
|
||||
let hdr = block.querySelector('.bib-anomaly-block-header')
|
||||
|| block.querySelector('.bib-global-batch__section-header');
|
||||
if (hdr) {
|
||||
hdr.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
|
||||
}
|
||||
@ -1576,6 +1573,50 @@
|
||||
}
|
||||
}
|
||||
|
||||
function bibCollapseGlobalBatchSection(section) {
|
||||
if (!section || section.classList.contains('is-collapsed')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var btnToggle = section.querySelector('.epr-block-toggle');
|
||||
if (btnToggle) {
|
||||
bibToggleCollapsibleBlock(section, btnToggle);
|
||||
} else {
|
||||
section.classList.add('is-collapsed');
|
||||
var hdr = section.querySelector('.bib-global-batch__section-header');
|
||||
if (hdr) {
|
||||
hdr.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bibToggleGlobalBatchSection(section, btnToggle) {
|
||||
if (!section || !btnToggle) {
|
||||
return;
|
||||
}
|
||||
|
||||
var willExpand = section.classList.contains('is-collapsed');
|
||||
var panel = bibGetGlobalBatchPanel();
|
||||
|
||||
if (willExpand && panel) {
|
||||
panel.querySelectorAll('.bib-global-batch__section').forEach(function (other) {
|
||||
if (other !== section) {
|
||||
bibCollapseGlobalBatchSection(other);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bibToggleCollapsibleBlock(section, btnToggle);
|
||||
|
||||
if (!section.classList.contains('is-collapsed')) {
|
||||
if (section.classList.contains('bib-global-batch--existing')) {
|
||||
updateGlobalBatchAnalysis();
|
||||
} else if (section.classList.contains('bib-global-batch--generated')) {
|
||||
updateGlobalBatchGeneratedAnalysis();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
moduleBib.addEventListener('click', function (e) {
|
||||
if (e.target.closest('.btn-aide-bib, .bib-aide-trigger, .btn-aide-trad, .btn-doc-trigger, .btn-admin-doc, .btn-trad-admin, .ms1-trad-link')) {
|
||||
return;
|
||||
@ -1592,11 +1633,31 @@
|
||||
return;
|
||||
}
|
||||
|
||||
let globalBatchHdr = e.target.closest('.bib-global-batch__section-header');
|
||||
if (globalBatchHdr && moduleBib.contains(globalBatchHdr)
|
||||
&& !e.target.closest('.epr-block-toggle, .btn-aide-bib, .bib-aide-trigger, .btn-aide-trad, .btn-trad-admin')) {
|
||||
e.preventDefault();
|
||||
let globalBatchSection = globalBatchHdr.closest('.bib-global-batch__section');
|
||||
let globalBatchBtn = globalBatchHdr.querySelector('.epr-block-toggle');
|
||||
if (globalBatchSection && globalBatchBtn) {
|
||||
bibToggleGlobalBatchSection(globalBatchSection, globalBatchBtn);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
let btnToggle = e.target.closest('.epr-block-toggle');
|
||||
if (!btnToggle || !moduleBib.contains(btnToggle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let globalBatchSection = btnToggle.closest('.bib-global-batch__section');
|
||||
if (globalBatchSection && bibGetGlobalBatchPanel()
|
||||
&& bibGetGlobalBatchPanel().contains(globalBatchSection)) {
|
||||
e.preventDefault();
|
||||
bibToggleGlobalBatchSection(globalBatchSection, btnToggle);
|
||||
return;
|
||||
}
|
||||
|
||||
let anomalyBlock = btnToggle.closest('.bib-anomaly-block');
|
||||
if (anomalyBlock) {
|
||||
e.preventDefault();
|
||||
@ -1627,6 +1688,18 @@
|
||||
if (e.key !== 'Enter' && e.key !== ' ') {
|
||||
return;
|
||||
}
|
||||
|
||||
let globalBatchHdr = e.target.closest('.bib-global-batch__section-header');
|
||||
if (globalBatchHdr && moduleBib.contains(globalBatchHdr)) {
|
||||
e.preventDefault();
|
||||
let globalBatchSection = globalBatchHdr.closest('.bib-global-batch__section');
|
||||
let globalBatchBtn = globalBatchHdr.querySelector('.epr-block-toggle');
|
||||
if (globalBatchSection && globalBatchBtn) {
|
||||
bibToggleGlobalBatchSection(globalBatchSection, globalBatchBtn);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
let anomalyHdr = e.target.closest('.bib-anomaly-block-header');
|
||||
if (!anomalyHdr || !moduleBib.contains(anomalyHdr)) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user