Skip to content

Commit 88ebc1a

Browse files
authored
Merge pull request #9742 from DataDog/brian.deutsch/selectors-banner-closed-fix
Fix gap on api pages on banner close
2 parents 1b6da05 + 5ae16e0 commit 88ebc1a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/scripts/components/announcement_banner.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
const handleApiToolbar = () => {
2+
const banner = document.querySelector('.announcement_banner');
3+
const toolbar = document.querySelector('.api-toolbar');
4+
5+
if (!banner.classList.value.includes('open')) {
6+
if (toolbar) {
7+
toolbar.style.top = '64px';
8+
}
9+
}
10+
}
11+
112
$(document).ready(function () {
13+
handleApiToolbar();
14+
215
$('.announcement_banner .icon').on('click', function () {
316
sessionStorage.setItem('announcement_banner', 'closed');
417
$('.announcement_banner').removeClass('open');
18+
handleApiToolbar();
519
$('html').removeClass('banner');
620
$(window).trigger('scroll');
721
});

src/styles/pages/_api.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ $ddpurple: #632ca6;
130130
background: white;
131131
position: sticky;
132132
z-index: 1;
133-
top: 95px;
133+
top: 94px;
134134
height: 65px;
135135
}
136136

0 commit comments

Comments
 (0)