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

Add support for not closeable tabs #45

Open
wants to merge 4 commits into
base: gh-pages
Choose a base branch
from

Conversation

se7kn8
Copy link

@se7kn8 se7kn8 commented Jan 30, 2019

With these changes, it's possible to have tabs which are not closeable by the user. To make it easier to close them programmatically, the addTab function now returns the created element, which can be later used to remove the tab.

@adamschwartz
Copy link
Owner

adamschwartz commented Apr 12, 2019

@SE7-KN8 Thanks so much for your contribution. After digging into it, I think I’d prefer to implement it in the reverse: keep the element in the template, but remove it if the option is passed. Would you mind making this change?

@se7kn8
Copy link
Author

se7kn8 commented Apr 12, 2019

No problem! I just changed it.

}

setTabCloseEventListener(tabEl) {
tabEl.querySelector('.chrome-tab-close').addEventListener('click', _ => this.removeTab(tabEl))
const tab = tabEl.querySelector('.chrome-tab-close')
if(tab !== null){
Copy link
Owner

Choose a reason for hiding this comment

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

Please conform to the existing code style, e.g. if(tab !== null){if (tab !== null) {.

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