-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Breadcrumbs do not work as intended. #9
Comments
I've also come across this, but the breadcrumbs seem to work when the card has a tag. |
wow, that's acc a good point, I don't like the look of tags but I can use the styling to hide them and still make sure that the breadcrumbs are visible, will test this and get back |
I think there is a bug with the else statement in the 'Split hierarchical tags' part of the Javascript. // Split hierarchical tags
var tagsContainerEl = document.querySelectorAll('.prettify-tags > *')
if (tagsContainerEl.length > 0) {
var tags = []
tagsContainerEl.forEach((tagEl) => {
tagEl.classList.add('prettify-tag')
tags.push(tagEl.innerHTML)
tags.forEach((tag) => {
var childTag = tag.split('::').filter(Boolean)
tagEl.innerHTML = childTag[childTag.length - 1].trim()
})
})
} else {
tagsContainerEl = document.querySelector('.prettify-tags')
var tags = tagsContainerEl.innerHTML.split(' ').filter(Boolean)
var html = ''
tags.forEach((tag) => {
var childTag = tag.split('::').filter(Boolean)
html +=
"<span class='prettify-tag'>" +
childTag[childTag.length - 1] +
'</span>'
})
tagsContainerEl.innerHTML = html
} So, when the card has no tags, the else statement runs and breaks the entire script. // Breadcrumbs to current deck
var deckEl = document.querySelector('.prettify-deck')
var subDecks = deckEl.innerHTML.split('::').filter(Boolean)
html = []
subDecks.forEach((subDeck) => {
html.push("<span class='prettify-subdeck'>" + subDeck + '</span>')
})
deckEl.innerHTML = html.join(' / ')
// Split hierarchical tags
var tagsContainerEl = document.querySelectorAll('.prettify-tags > *')
if (tagsContainerEl.length > 0) {
var tags = []
tagsContainerEl.forEach((tagEl) => {
tagEl.classList.add('prettify-tag')
tags.push(tagEl.innerHTML)
tags.forEach((tag) => {
var childTag = tag.split('::').filter(Boolean)
tagEl.innerHTML = childTag[childTag.length - 1].trim()
})
})
} else {
tagsContainerEl = document.querySelector('.prettify-tags')
var tags = tagsContainerEl.innerHTML.split(' ').filter(Boolean)
var html = ''
tags.forEach((tag) => {
var childTag = tag.split('::').filter(Boolean)
html +=
"<span class='prettify-tag'>" +
childTag[childTag.length - 1] +
'</span>'
})
tagsContainerEl.innerHTML = html
} It's a workaround, but it works. |
Love the theme, however came across a bug. Testing on Version 2.1.54 (b6a7760c) and Python 3.9.7 Qt 6.3.1, the breadcrumbs are not working. See screenshot:
I have only changed the color variables and font, so it looks a bit different.
The text was updated successfully, but these errors were encountered: