Enhance bib tool styles and functionality, increment version code to 4.72.770
This commit introduces new CSS styles for the bib tool buttons and detail panel, improving their visual presentation and interactivity. It also adds functionality for displaying anomaly navigation badges, enhancing user experience. The version code is incremented to 4.72.770 to reflect these updates.
This commit is contained in:
@ -471,23 +471,55 @@
|
||||
}
|
||||
|
||||
if (toolId === 'qty_summary') {
|
||||
var qtyBadges = panel.querySelector('.bib-qty-summary-badges');
|
||||
if (qtyBadges) {
|
||||
dest.innerHTML = qtyBadges.outerHTML;
|
||||
}
|
||||
dest.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
if (toolId === 'anomalies') {
|
||||
var anomCount = panel.querySelector('.bib-anomalies-count');
|
||||
var destBadge = dest.querySelector('[data-bib-anomalies-nav-badge]');
|
||||
var strTodo = bibJs('jsAnomaliesNavTodo') || 'Élément à valider';
|
||||
var intCount = 0;
|
||||
var blnPending = true;
|
||||
|
||||
if (anomCount) {
|
||||
dest.innerHTML = anomCount.outerHTML;
|
||||
blnPending = anomCount.getAttribute('aria-busy') === 'true';
|
||||
if (!blnPending) {
|
||||
intCount = parseInt(String(anomCount.textContent || '').trim(), 10);
|
||||
if (isNaN(intCount)) {
|
||||
intCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!destBadge) {
|
||||
dest.innerHTML = '';
|
||||
if (!blnPending && intCount > 0) {
|
||||
dest.innerHTML = '<span class="epr-header-summary bib-event-config-note bib-anomalies-nav-badge"'
|
||||
+ ' data-bib-anomalies-nav-badge="1"'
|
||||
+ ' title="' + strTodo.replace(/"/g, '"') + '">'
|
||||
+ strTodo
|
||||
+ '</span>';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (blnPending || intCount <= 0) {
|
||||
destBadge.classList.add('bib-ui-hidden');
|
||||
destBadge.setAttribute('aria-hidden', 'true');
|
||||
destBadge.textContent = '';
|
||||
} else {
|
||||
destBadge.classList.remove('bib-ui-hidden');
|
||||
destBadge.removeAttribute('aria-hidden');
|
||||
destBadge.textContent = strTodo;
|
||||
destBadge.setAttribute('title', strTodo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bibSyncAllToolNavBadges() {
|
||||
['event_config', 'qty_summary', 'anomalies'].forEach(bibSyncToolNavBadges);
|
||||
bibSyncToolNavBadges('event_config');
|
||||
bibSyncToolNavBadges('anomalies');
|
||||
}
|
||||
|
||||
function bibEnsureToolLoaded(toolId) {
|
||||
@ -915,6 +947,12 @@
|
||||
});
|
||||
|
||||
moduleBib.addEventListener('click', function (e) {
|
||||
if (e.target.closest('.bib-tool-detail__close')) {
|
||||
e.preventDefault();
|
||||
bibCloseTool();
|
||||
return;
|
||||
}
|
||||
|
||||
var toolBtn = e.target.closest('.bib-tool-btn');
|
||||
if (toolBtn && moduleBib.contains(toolBtn)) {
|
||||
if (e.target.closest('.btn-aide-bib, .bib-aide-trigger, .btn-aide-trad, .btn-doc-trigger, .btn-admin-doc, .btn-trad-admin')) {
|
||||
|
||||
Reference in New Issue
Block a user