Logging: QoL improvements to the single file view (#43146)

* Clear line highlight with a click

* Vertically center log file line when selected

* Add changelog file
This commit is contained in:
Corey McKrill 2023-12-28 01:31:31 -08:00 committed by GitHub
parent 8e7c5cca1c
commit 718978f840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Allow a log file line that has been highlighted to be un-highlighted

View File

@ -1391,7 +1391,6 @@ table.wc_status_table--tools {
.line {
display: block;
width: 100%;
scroll-margin-top: 6em;
position: relative;
&:before {
@ -1407,6 +1406,7 @@ table.wc_status_table--tools {
&:target {
box-shadow: 0 0.16em 0.16em -0.16em #c3c4c7, 0 -0.16em 0.16em -0.16em #c3c4c7;
z-index: 1;
scroll-margin-top: 50vh;
.line-content {
background: #fff8c5;
@ -4370,7 +4370,7 @@ table.wc_shipping {
.wc-backbone-modal-back-inactive {
display: none;
}
#btn-next.is-busy {
background-image: linear-gradient(-45deg, #fafafa 33%, #e0e0e0 33%, #e0e0e0 70%, #fafafa 70%);
animation-duration: 2.5s;

View File

@ -294,6 +294,17 @@ class PageController {
?>
<?php endwhile; ?>
</section>
<script>
// Clear the line number hash and highlight with a click.
document.documentElement.addEventListener( 'click', ( event ) => {
if ( window.location.hash && ! event.target.classList.contains( 'line-anchor' ) ) {
let scrollPos = document.documentElement.scrollTop;
window.location.hash = '';
document.documentElement.scrollTop = scrollPos;
history.replaceState( null, '', window.location.pathname + window.location.search );
}
} );
</script>
<?php
}