Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add loadNavbarOnCover configuration #1376

Closed
wants to merge 5 commits into from

Conversation

sy-records
Copy link
Member

@sy-records sy-records commented Sep 19, 2020

Summary

resolve #1375

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Repo settings
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

@vercel
Copy link

vercel bot commented Sep 19, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/jbpg8v8eg
✅ Preview: https://docsify-preview-git-feat-1375.docsify-core.now.sh

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 19, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1f9e427:

Sandbox Source
docsify-template Configuration

@sy-records sy-records requested review from anikethsaha and a team September 19, 2020 00:32
Copy link
Member

@anikethsaha anikethsaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change, other than that, LGTM

cypress/fixtures/tpl/docs.index.html Outdated Show resolved Hide resolved
anikethsaha
anikethsaha previously approved these changes Sep 19, 2020
Copy link
Member

@Koooooo-7 Koooooo-7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little problem.
Steps:

  1. set loadNavbarOnCover: false,.
  2. clink to another selection.
  3. clink the back button of the browser, it will back to the cover page.
    the nav will show on the cover now.

@sy-records
Copy link
Member Author

This is caused by not reloading the page, I think that's acceptable.
It just doesn't show up when you visit the home page directly.

@Koooooo-7
Copy link
Member

Koooooo-7 commented Sep 19, 2020

This is caused by not reloading the page, I think that's acceptable.
It just doesn't show up when you visit the home page directly.

It make no sense, there is no reason to make an element visible, which had been set not show.
There is one way I found to make it, FYR.

    // Load nav
    if (loadNavbar) {
      // default show the nav
      document.querySelector('.app-nav').style.display = 'inline';
      if (path === '/' && !loadNavbarOnCover) {
        // hidden nav on cover
        document.querySelector('.app-nav').style.display = 'none';
        return;
      }

Maybe you could get another brilliant one :).

Copy link
Member

@Koooooo-7 Koooooo-7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well.
I think the test is not a test actually, it just check the configuration property exist, not checking if it works tho.

Besides that, I think we need concern about refactoring the nav, for some reason. #1230

fix

Update docs.index.html

fix

fix

fix

Update docs.index.html

fix

Update docs.index.html

fix

remove test

Update docs.index.html

update
src/core/config.js Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to disable the showing of the navigation bar on the cover
3 participants