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; // IMPORTANT: do nothing without anchor | |||
if (!hash) return; | |||
const id = hash. | const id = location.hash.slice(1); | ||
setTimeout(function(){ | setTimeout(function(){ | ||
| Line 141: | Line 140: | ||
panel.scrollIntoView({block:'start'}); | panel.scrollIntoView({block:'start'}); | ||
},150); | |||
}, | |||
}); | }); | ||