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

Fix turning off modal overlay in successive tour starts #277

Merged
merged 2 commits into from
Nov 28, 2018

Conversation

BrianSipple
Copy link
Contributor

@BrianSipple BrianSipple commented Nov 25, 2018

Currently, the showOrHideModal function is being called for each step
on the hide and destroy events. This leads to it getting called before a tour is re-shown -- after being shown once and then closed:

modal-hiding-bug

Moving the hide call up to the service itself fixes this.

@BrianSipple BrianSipple force-pushed the fix-modal-overlay-toggling branch 2 times, most recently from e5f7b59 to 5ed276f Compare November 25, 2018 07:31
* @private
*/
_showOrHideModal(showOrHide) {
const show = showOrHide === 'show';
_showModalOverlay() {
Copy link
Owner

Choose a reason for hiding this comment

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

Why did we split this function up? Code Climate doesn't like that we have essentially the same code twice. Can we please keep it as one function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking that an explicit function would be less error prone: no manual arg passing and parsing. I can change it back, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rwwagner90 Out of curiosity, though, Is there a way to tell Code Climate to chill?

Copy link
Owner

Choose a reason for hiding this comment

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

I tend to prefer to keep things DRY and not have two functions that are essentially the same. We can definitely tweak Code Climate too though. There is probably a setting for number of lines of duplication before it flags it.

Currently, the `showOrHideModal` function is being called for each step
on the `'hide' and 'destroy' events. This has the effect of calling it before
showing a tour again after closing it.

Moving the hide call up to the service itself fixes this.
@RobbieTheWagner RobbieTheWagner merged commit 7132157 into master Nov 28, 2018
@RobbieTheWagner RobbieTheWagner deleted the fix-modal-overlay-toggling branch November 28, 2018 13:18
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