mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 19:34:15 -05:00
Show expander arrow for all browsers
The polyfill we use for details/summary only renders the arrow if the browser doesn’t natively support the feature. The latest versions of Firefox _do_ now support the feature (after 5 years), but for some reason they don’t draw the arrow. So this commit forces the arrow to be polyfilled in all browsers, and hides the browser default one, for those browsers that do render it.
This commit is contained in:
@@ -133,22 +133,20 @@
|
||||
|
||||
// If this is not a native implementation, create an arrow
|
||||
// inside the summary
|
||||
if (!NATIVE_DETAILS) {
|
||||
|
||||
var twisty = document.createElement('i');
|
||||
|
||||
if (openAttr === true) {
|
||||
twisty.className = 'arrow arrow-open';
|
||||
twisty.appendChild(document.createTextNode('\u25bc'));
|
||||
} else {
|
||||
twisty.className = 'arrow arrow-closed';
|
||||
twisty.appendChild(document.createTextNode('\u25ba'));
|
||||
}
|
||||
|
||||
details.__summary.__twisty = details.__summary.insertBefore(twisty, details.__summary.firstChild);
|
||||
details.__summary.__twisty.setAttribute('aria-hidden', 'true');
|
||||
var twisty = document.createElement('i');
|
||||
|
||||
if (openAttr === true) {
|
||||
twisty.className = 'arrow arrow-open';
|
||||
twisty.appendChild(document.createTextNode('\u25bc'));
|
||||
} else {
|
||||
twisty.className = 'arrow arrow-closed';
|
||||
twisty.appendChild(document.createTextNode('\u25ba'));
|
||||
}
|
||||
|
||||
details.__summary.__twisty = details.__summary.insertBefore(twisty, details.__summary.firstChild);
|
||||
details.__summary.__twisty.setAttribute('aria-hidden', 'true');
|
||||
|
||||
}
|
||||
|
||||
// Define a statechange function that updates aria-expanded and style.display
|
||||
|
||||
@@ -192,3 +192,25 @@ details summary {
|
||||
.tabular-numbers {
|
||||
@include core-19($tabular-numbers: true);
|
||||
}
|
||||
|
||||
summary::-moz-details-marker {
|
||||
display: none;
|
||||
}
|
||||
summary::-ms-details-marker {
|
||||
display: none;
|
||||
}
|
||||
summary::-o-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
summary::details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
details .arrow {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user