docs: fix opening url with anchors to widget properties
This commit is contained in:
parent
68fa054610
commit
645bba0402
1 changed files with 13 additions and 3 deletions
|
|
@ -3,9 +3,19 @@ document.addEventListener('DOMContentLoaded', ()=>{
|
|||
if (window.location.hash && window.location.href.includes('properties-reference')) {
|
||||
// show target in tabs/details
|
||||
document.querySelectorAll('[id='+window.location.hash.split("#")[1]+']').forEach(function(item){
|
||||
var tab = item.closest('.tabbed-content'),
|
||||
details = item.closest('details')
|
||||
if (tab) tab.previousSibling.click()
|
||||
var tab = item.closest('.tabbed-block'),
|
||||
container= item.closest('.tabbed-set'),
|
||||
details = item.closest('details'),
|
||||
index = 0
|
||||
while (tab.previousElementSibling) {
|
||||
index++
|
||||
tab = tab.previousElementSibling
|
||||
}
|
||||
console.log(index)
|
||||
container.querySelectorAll('.tabbed-labels label:nth-child('+(index+1)+')').forEach(function(item,i){
|
||||
item.click()
|
||||
})
|
||||
|
||||
if (item) {
|
||||
item.scrollIntoView()
|
||||
document.documentElement.scrollTop -= 70
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue