MediaWiki:Common.js: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 116: | Line 116: | ||
mw.hook('wikipage.content').add(function () { | mw.hook('wikipage.content').add(function () { | ||
if (!location.hash) return; | if (!location.hash) return; | ||
const id = location.hash.slice(1); | const id = location.hash.slice(1); | ||
| Line 124: | Line 124: | ||
const item = document.querySelector('.ooo-browser__item[data-target="'+id+'"]'); | const item = document.querySelector('.ooo-browser__item[data-target="'+id+'"]'); | ||
const panel = document.getElementById(id); | const panel = document.getElementById(id); | ||
if (!item || !panel) return; | if (!item || !panel) return; | ||
| Line 137: | Line 138: | ||
item.classList.add('is-active'); | item.classList.add('is-active'); | ||
panel.classList.add('is-active'); | panel.classList.add('is-active'); | ||
},150); | },150); | ||
}); | }); | ||