Compare commits
2 commits
6a59d9f6ad
...
a029fd9265
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a029fd9265 | ||
|
|
96b2e8eedd |
4 changed files with 30 additions and 46 deletions
|
|
@ -77,22 +77,36 @@
|
||||||
|
|
||||||
/* ---------- Floating notification (_showNotification) ---------- */
|
/* ---------- Floating notification (_showNotification) ---------- */
|
||||||
|
|
||||||
/* Was a 200-character inline style written from JS on every call. */
|
/* Was a 200-character inline style written from JS on every call.
|
||||||
.eskaera-notification {
|
*
|
||||||
|
* The `.alert` qualifier is load-bearing, not decoration. This addon's
|
||||||
|
* partials reach the page through @import, which the CSS spec hoists above
|
||||||
|
* every other rule in the bundle — so an equal-specificity Bootstrap rule
|
||||||
|
* always comes later and wins. `.alert` (0,1,0) therefore beat a bare
|
||||||
|
* `.eskaera-notification` (0,1,0) on `position`, pinning the toast to
|
||||||
|
* `relative` and leaving it in normal flow at the foot of <body>, below the
|
||||||
|
* footer: every error and confirmation rendered off-screen. `.alert
|
||||||
|
* .eskaera-notification` (0,2,0) settles it without !important.
|
||||||
|
*
|
||||||
|
* `.fade` does the same to `transition`, and `.alert` to `padding` — which
|
||||||
|
* rides on Bootstrap's own custom properties here, as .badge-km and
|
||||||
|
* .product-card > .card already do. */
|
||||||
|
.alert.eskaera-notification {
|
||||||
|
--alert-padding-x: var(--ac-space-lg);
|
||||||
|
--alert-padding-y: var(--ac-space-lg);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 5rem;
|
top: 5rem;
|
||||||
right: var(--ac-space-md);
|
right: var(--ac-space-md);
|
||||||
z-index: var(--ac-z-notification);
|
z-index: var(--ac-z-notification);
|
||||||
min-width: 18.75rem;
|
min-width: 18.75rem;
|
||||||
max-width: 31.25rem;
|
max-width: 31.25rem;
|
||||||
padding: var(--ac-space-lg);
|
|
||||||
font-size: var(--ac-text-md);
|
font-size: var(--ac-text-md);
|
||||||
box-shadow: var(--ac-shadow-lg);
|
box-shadow: var(--ac-shadow-lg);
|
||||||
transition: opacity var(--ac-transition-normal);
|
transition: opacity var(--ac-transition-normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 576px) {
|
@media (max-width: 576px) {
|
||||||
.eskaera-notification {
|
.alert.eskaera-notification {
|
||||||
left: var(--ac-space-md);
|
left: var(--ac-space-md);
|
||||||
right: var(--ac-space-md);
|
right: var(--ac-space-md);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
@ -101,7 +115,7 @@
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
.toast-notification,
|
.toast-notification,
|
||||||
.eskaera-notification {
|
.alert.eskaera-notification {
|
||||||
transition: none;
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,9 +132,10 @@ console.log("[INFINITE_SCROLL] Script loaded!");
|
||||||
console.log("[INFINITE_SCROLL] eskaera-config element:", configEl);
|
console.log("[INFINITE_SCROLL] eskaera-config element:", configEl);
|
||||||
|
|
||||||
if (!configEl) {
|
if (!configEl) {
|
||||||
console.error(
|
// Expected on every eskaera page that has no product grid
|
||||||
"[INFINITE_SCROLL] ❌ No eskaera-config found, lazy loading disabled"
|
// (orders list, checkout, ...): this script is loaded
|
||||||
);
|
// site-wide, not just on the shop page.
|
||||||
|
console.log("[INFINITE_SCROLL] No eskaera-config found, lazy loading disabled");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -738,8 +738,13 @@
|
||||||
"alert alert-" + type + " alert-dismissible fade show eskaera-notification";
|
"alert alert-" + type + " alert-dismissible fade show eskaera-notification";
|
||||||
// Announce it: errors and warnings are the whole point of this helper,
|
// Announce it: errors and warnings are the whole point of this helper,
|
||||||
// and without a live role a screen reader never hears them.
|
// and without a live role a screen reader never hears them.
|
||||||
notification.setAttribute("role", type === "error" ? "alert" : "status");
|
// The test was `type === "error"`, which no caller ever passes — the
|
||||||
notification.setAttribute("aria-live", type === "error" ? "assertive" : "polite");
|
// class has to name a Bootstrap variant, so failures come through as
|
||||||
|
// "danger". Every error was therefore announced politely, i.e. queued
|
||||||
|
// behind whatever the screen reader was already saying.
|
||||||
|
var isUrgent = type === "danger" || type === "warning";
|
||||||
|
notification.setAttribute("role", isUrgent ? "alert" : "status");
|
||||||
|
notification.setAttribute("aria-live", isUrgent ? "assertive" : "polite");
|
||||||
notification.innerHTML =
|
notification.innerHTML =
|
||||||
message +
|
message +
|
||||||
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="' +
|
'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="' +
|
||||||
|
|
|
||||||
|
|
@ -69,42 +69,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
(function() {
|
|
||||||
'use strict';
|
|
||||||
// console.log('[eskaera_page] Loading translated labels for category selector');
|
|
||||||
|
|
||||||
// Fetch translated labels from endpoint
|
|
||||||
fetch('/eskaera/labels', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'X-CSRFToken': odoo.csrf_token || ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
var labels = data.result || data;
|
|
||||||
//console.log('[eskaera_page] Labels received:', labels);
|
|
||||||
|
|
||||||
// Update category selector first option text
|
|
||||||
var categorySelect = document.getElementById('realtime-category-select');
|
|
||||||
if (categorySelect && categorySelect.options[0] && labels && labels.all_categories) {
|
|
||||||
categorySelect.options[0].text = labels.all_categories;
|
|
||||||
// console.log('[eskaera_page] Updated category selector to:', labels.all_categories);
|
|
||||||
} else {
|
|
||||||
console.log('[eskaera_page] Could not update category selector');
|
|
||||||
console.log(' categorySelect:', !!categorySelect);
|
|
||||||
console.log(' categorySelect.options[0]:', categorySelect ? !!categorySelect.options[0] : false);
|
|
||||||
console.log(' labels:', !!labels);
|
|
||||||
console.log(' labels.all_categories:', labels ? labels.all_categories : 'N/A');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error('[eskaera_page] Error fetching labels:', error);
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
</t>
|
</t>
|
||||||
</template>
|
</template>
|
||||||
<template id="eskaera_order_card_meta" name="Order Card Metadata">
|
<template id="eskaera_order_card_meta" name="Order Card Metadata">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue