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

Adding an expand button #62

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

DragoVeizen
Copy link
Member

fixes #45
Button still to be customised and placed accordingly
unknown
s2

Copy link
Member

@daemon1024 daemon1024 left a comment

Choose a reason for hiding this comment

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

Some nits here and there. Rest LGTM :D

js/tab-manager.js Outdated Show resolved Hide resolved
js/tab-manager.js Outdated Show resolved Hide resolved
js/tab-manager.js Outdated Show resolved Hide resolved
js/tab-manager.js Outdated Show resolved Hide resolved
Copy link
Member

@akshgpt7 akshgpt7 left a comment

Choose a reason for hiding this comment

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

This looks like a nice feature!
I'd only say that can you change the button text to "Collapse" by default, and when the group is hidden (collapsed), the button text becomes "Expand".
You can create a boolean which stores if the group is collapsed or not.

js/tab-manager.js Outdated Show resolved Hide resolved
@DragoVeizen
Copy link
Member Author

Will work on the changes and get back to you

@DragoVeizen
Copy link
Member Author

Implemented all the changes and fixes i was instructed to.
image
image
Reviews and suggestions are welcome.

} else {
content.style.maxHeight = content.scrollHeight + "px";
document.getElementById("expand").innerHTML = "⯅";
content.style.margin = 16 + "px";
Copy link
Member

Choose a reason for hiding this comment

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

You can directly put content.style.margin = "16px"; here :)

Comment on lines +191 to +196
if (content.style.maxHeight) {
document.getElementById("expand").innerHTML = "⯆";
content.style.maxHeight = null;
content.style.margin = 0;
} else {
content.style.maxHeight = content.scrollHeight + "px";
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain what you are trying to do here? I'm a bit confused about what's happening here 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

So basically i wanted to animate the collapse/expand effect but as it turns out
image
So i couldn't use the transition effect on it.
So i used maxHeight property as a substitute.
When maxHeight of the collapsible is null, it will expand and the value of maxHeight will be equal to the height of the content ie ScrollHeight .
When maxHeight of the collapsible is not null, it will collapse thus taking a value of zero/null.
and then i put this in the transition property that can be found in the css file.
Hope this clears your query.

Copy link
Member

Choose a reason for hiding this comment

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

aah, got it. Good to know. Thanks :)

@aayushmau5
Copy link
Member

@DragoVeizen Found some bugs during testing.

  1. When we have more than one tab groups, clicking on the expand/collapse button only exapnds/collapses the latest tab group. Even after I click on other tab groups, it modifies the latest one.
  2. I'm not sure if it's only happening for me(@daemon1024 @akshgpt7 Please confirm), but the popup doesn't show any tabs in it. It's just empty.

@DragoVeizen Since you haven't touched anything from popup.js, I don't think you should worry about the 2nd issue now. Just focus on the first one :)

@DragoVeizen
Copy link
Member Author

DragoVeizen commented Aug 15, 2021

Oh okay..ill check it out :)

@akshgpt7
Copy link
Member

Hey, @DragoVeizen any updates on this?

@DragoVeizen
Copy link
Member Author

No not really i was investing most of my time somewhere else ill get back to this in a day or two and hopefully make it right.

@akshgpt7
Copy link
Member

cool, no problem, just checking :D

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.

Collapse and Expand Tab Groups
4 participants