- gitlist.git
- src
- browser
- js
- global
- hash.js
This file ( 726B ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
window.gitlist.pushHash = (hash) => {
if(history.pushState) {
const pushState = location.pathname + hash;
history.pushState(null, null, pushState);
}
else {
location.hash = hash;
}
};
window.gitlist.scrollHash = function(element, event) {
const url = new URL(element.href)
const id = url.hash.substring(1)
const elfind = document.getElementById(id + '-parent')
const elfind2 = document.getElementById(id)
if (elfind === null && elfind2 === null) {
return true;
}
window.gitlist.scrollIntoView(elfind || elfind2);
if (event !== undefined) {
event.preventDefault()
window.gitlist.pushHash(url.hash)
}
return false;
}