0.0.146 dynamic replace title

This commit is contained in:
SBD
2024-01-06 13:39:39 +03:00
parent 2bbf2f7de5
commit ab25c36b2e

View File

@@ -58,9 +58,8 @@ function renderContent (el=null) {
data: JSON.stringify(data),
success: function(data){
document.querySelector(".content").innerHTML = data.html
document.title = data.title
window.scrollTo(0, 0);
let lang = getLang()
window.scrollTo(0, 0);
replaceHrefOnOnclick()
if (el){
history.pushState({
@@ -70,6 +69,9 @@ function renderContent (el=null) {
`/${lang}/section/${el.dataset['url']}/`
)
}
if (window.location.href !== `${window.location.origin}/${lang}/`){
document.title = data.title
}
resetSlider()
autoPlaySlider()
replace_select_language()