Commit 3634f842 authored by Andrea Giammarchi's avatar Andrea Giammarchi

Issue 6922 - Provide a fallback for unknown notifications type

parent 66b54d60
Pipeline #29488630 passed with stages
in 7 minutes and 6 seconds
......@@ -33,6 +33,12 @@
box-sizing: border-box;
}
[hidden],
[aria-hidden="true"]
{
display: none !important;
}
html,
body,
h1,
......@@ -121,6 +127,7 @@ html[dir="rtl"] header h1
header .notification::before
{
--border-top-color: var(--border-color-primary);
display: block;
overflow: hidden;
height: var(--border-width-thick-doubled);
......@@ -166,6 +173,11 @@ header .notification > div
padding: var(--padding-primary);
}
header .notification h3[hidden] + p
{
margin-top: 0;
}
header .notification h3
{
margin: 0;
......@@ -185,22 +197,26 @@ header .notification h3::before
content: "";
}
html:not([dir="rtl"]) header .notification h3
html:not([dir="rtl"]) header .notification.critical h3,
html:not([dir="rtl"]) header .notification.information h3
{
padding-left: 24px;
}
html:not([dir="rtl"]) header .notification h3::before
html:not([dir="rtl"]) header .notification.critical h3::before,
html:not([dir="rtl"]) header .notification.information h3::before
{
margin-left: -24px;
}
html[dir="rtl"] header .notification h3
html[dir="rtl"] header .notification.critical h3,
html[dir="rtl"] header .notification.information h3
{
padding-right: 24px;
}
html[dir="rtl"] header .notification h3::before
html[dir="rtl"] header .notification.critical h3::before,
html[dir="rtl"] header .notification.information h3::before
{
margin-right: -24px;
}
......@@ -230,10 +246,9 @@ header .notification button
font-size: var(--font-size-primary);
}
header .notification hr + button
header .notification button
{
margin-top: var(--margin-primary-half);
margin-bottom: var(--margin-primary-half);
}
#options
......
......@@ -58,7 +58,9 @@ window.addEventListener(
const notifier = wire()`
<div class="${"notification " + notification.type}">
<div>
<h3>${notification.texts.title}</h3>
<h3 hidden="${!notification.texts.title}">
${notification.texts.title}
</h3>
<p id="notification-message"></p>
<hr>
<button onclick="${dismiss}">
......@@ -66,7 +68,7 @@ window.addEventListener(
</button>
<button
data-pref="notifications_ignoredcategories"
hidden="${notification.type == "critical"}"
hidden="${/^(?:critical|relentless)$/.test(notification.type)}"
onclick="${dismiss}">
${{i18n: "overlay_notification_closing_button_optout"}}
</button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment