Skip to content

Commit 001a54b

Browse files
committed
compatibility with @neo4j-antora/roles-labels < 0.1.5
1 parent 9753cbc commit 001a54b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/js/60-docs-roles.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ document.addEventListener('DOMContentLoaded', function () {
154154
}
155155
}
156156

157-
console.log(roleDiv.classList)
157+
// console.log(roleDiv.classList)
158158

159159
if (roleDiv.classList.contains('admonitionblock')) {
160160
labelsLocation = roleDiv.querySelector('td.content')
@@ -169,6 +169,17 @@ document.addEventListener('DOMContentLoaded', function () {
169169
}
170170
})
171171

172+
// for compatibility with @neo4j-antora/roles-labels < 0.1.5
173+
// get all the exampleblocks where there is a child title and labels div
174+
// for every block, if it has a title and labels div, move the title div to be the first child of the exampleblock
175+
const labeledExamples = document.querySelectorAll('div.exampleblock.has-label')
176+
labeledExamples.forEach(function (example) {
177+
const titleDiv = example.querySelector('div.title')
178+
if (titleDiv) {
179+
example.prepend(titleDiv)
180+
}
181+
})
182+
172183
// check whether div containing header labels has wrapped onto new line
173184
// if it has wrapped, we left-align the div
174185
checkWrapped()

0 commit comments

Comments
 (0)