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

Multiple panels with `tracy-focused` class #316

Closed
adrianbj opened this issue Sep 19, 2018 · 4 comments
Closed

Multiple panels with `tracy-focused` class #316

adrianbj opened this issue Sep 19, 2018 · 4 comments

Comments

@adrianbj
Copy link
Contributor

@adrianbj adrianbj commented Sep 19, 2018

Version: 2.5.2

Bug Description

Not sure if this is expected behavior, but it seems that once a panel has been focused, it never loses the tracy-focused class when other panels are clicked, bringing them to the top of the stack. A panel has to be closed to lose the class.

Steps To Reproduce

Open more than one panel and click on one and then the other so that they are focused and their z-index adjusted so that they are on top. Look at the inspector and notice that tracy-focused is not removed.

Expected Behavior

Only one panel at a time should have the tracy-focused class.

Possible Solution

Adjust the bar.js blur() method to remove the if (this.is(Panel.PEEK)) { conditional.
Is there a reason for this condition?

dg added a commit that referenced this issue Sep 20, 2018
dg added a commit that referenced this issue Sep 20, 2018
@dg dg closed this in 74740f8 Sep 20, 2018
@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Sep 20, 2018

Thanks, fixed

@adrianbj

This comment has been minimized.

Copy link
Contributor Author

@adrianbj adrianbj commented Sep 20, 2018

@dg - thanks for the fix, but would you mind adjusting to something like this:

for (var id in Debug.panels) {
    if(id !== elem.id) Debug.panels[id].elem.classList.remove(Panel.FOCUSED);
}

so that it isn't removed and then added back again.

I have a MutationObserver that is checking for addition of the tracy-focused class to a panel. Because you are now removing it and then adding it again the observer notes a change which really isn't the case.

I don't think there would be any side-effects to that change?

Do you think this would be ok?

Thanks.

dg added a commit that referenced this issue Sep 20, 2018
@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Sep 20, 2018

I tried to fix it.

dg added a commit that referenced this issue Sep 20, 2018
dg added a commit that referenced this issue Sep 20, 2018
dg added a commit that referenced this issue Sep 20, 2018
@adrianbj

This comment has been minimized.

Copy link
Contributor Author

@adrianbj adrianbj commented Sep 20, 2018

Thanks, that seems to work and also plays nicely with my MutationObserver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.