Skip to content

Conversation

Dharmendra205111014
Copy link
Contributor

Hi,

Few more fixes in continuation of issue #377 and last PR #378

  • Reset loading state when spec changes
  • Reset navbar active class from path/tag/link

Signed-off-by: Dharmendra dharmendra.patel26@gmail.com

- Fixed loading state when spec changes

Signed-off-by: Dharmendra <dharmendra.patel26@gmail.com>
src/rapidoc.js Outdated
}
}

resetDoc() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

resetDoc name is misleading, there are many states in a the doc, it is just reseting the loader and some classes.

IMO, we do not need a separate method for this, just put these statements in loadSpec() method

src/rapidoc.js Outdated
this.loadFailed = false;
this.requestUpdate();

// Remove the previous active tag
Copy link
Collaborator

Choose a reason for hiding this comment

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

NavBar is available in read and focused mode only, so check if renderStyle is focused or read then only perform these statements

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated PR

@Dharmendra205111014 Dharmendra205111014 force-pushed the bugfix/reset-state-on-spec-change branch from b6fa1ef to 416f673 Compare December 9, 2020 05:05
Copy link
Collaborator

@mrin9 mrin9 left a comment

Choose a reason for hiding this comment

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

LGTM

@mrin9 mrin9 merged commit 3130237 into rapi-doc:master Dec 9, 2020
@mrin9
Copy link
Collaborator

mrin9 commented Dec 9, 2020

Thanks for the PR !!!

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.

2 participants