Skip to content

Commit

Permalink
fix left nav below 1280
Browse files Browse the repository at this point in the history
  • Loading branch information
sean1588 committed Dec 30, 2024
1 parent 8b25bb4 commit ec1e0e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
6 changes: 3 additions & 3 deletions theme/src/scss/docs/_docs-main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ body.section-registry {
}
}

@media (min-width: 1280px) {
@media (min-width: 1024px) {
width: 240px;
flex-basis: 240px;
box-shadow: none;
Expand Down Expand Up @@ -354,7 +354,7 @@ body.section-registry {
flex-direction: column;
}

@media (min-width: 1280px) {
@media (min-width: 1024px) {
margin-left: 24px;
max-width: 700px;
min-width: 0;
Expand Down Expand Up @@ -422,7 +422,7 @@ body.section-registry {
width: 240px;
}

@media (min-width: 1280px) {
@media (min-width: 1024px) {
min-width: 340px;
}
}
Expand Down
16 changes: 5 additions & 11 deletions theme/src/ts/docs-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ $(window).on("load", function() {
})(document, jQuery);

function setDocsMainNavPosition() {
if ($(this).width() <= 1280) {
if ($(this).width() <= 1024) {
if (docsMainNavToggleWrapper.hasClass("docs-nav-show")) {
docsNavToggleIcon.removeClass("open-docs-main-nav")
docsNavToggleIcon.addClass("close-docs-main-nav");
Expand All @@ -100,7 +100,7 @@ function setDocsMainNavPosition() {
}
}

if ($(this).width() > 1280) {
if ($(this).width() > 1024) {
docsMainNavToggleWrapper.removeClass("docs-nav-show");
docsMainNavToggleWrapper.removeClass("docs-nav-hide");
} else if (!docsMainNavToggleWrapper.hasClass("docs-nav-hide") && !docsMainNavToggleWrapper.hasClass("docs-nav-show")) {
Expand All @@ -111,16 +111,10 @@ function setDocsMainNavPosition() {
function setTableOfContentsVisibility() {
let docsTableOfContents = $(".docs-toc-desktop");

if (window.innerWidth > 1024 && window.innerWidth <= 1280) {
if (docsMainNavToggleWrapper.hasClass("docs-nav-show")) {
docsTableOfContents.hide();
} else {
docsTableOfContents.show();
}
} else if (window.innerWidth > 1280) {
docsTableOfContents.show();
} else {
if (window.innerWidth < 1280) {
docsTableOfContents.hide();
} else {
docsTableOfContents.show();
}
}

Expand Down

0 comments on commit ec1e0e1

Please sign in to comment.