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

Toggling external content #68

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ihostage
Copy link

Fixes #67

@ihostage
Copy link
Author

So, It works 😄

The module file is generated in ... for [.lang-java]#Java# [.lang-scala]#Scala#

[tabs%sync,sync-group-id=lang]
====
Java:: Java
Scala:: Scala
====

chrome-capture-2023-12-20

init(document.querySelectorAll('.tabs'))

function init (tabsBlocks) {
if (!tabsBlocks.length) return
forEach.call(tabsBlocks, function (tabs) {
var syncIds = tabs.classList.contains('is-sync') ? {} : undefined
var tablist = tabs.querySelector('.tablist ul')
if (!tablist) return
Copy link
Author

Choose a reason for hiding this comment

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

Just The Boy Scout Rule. Fixed an exception that is thrown when I had a [.tags] paragraph on my page.

@@ -4,13 +4,23 @@
var config = (document.currentScript || {}).dataset || {}
var forEach = Array.prototype.forEach

document.addEventListener('asciidoctor-tabs:toggle', function (event) {
Copy link
Author

Choose a reason for hiding this comment

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

@mojavelinux WDYT about staying this small function here? I know, you said this is not within the scope of this project. And we can move it to our UI bundle. But it looks pretty safety and can be useful for many people.

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.

Toggling external content
1 participant