delay added, text changed
This commit is contained in:
parent
b58cfead05
commit
28caddf3c1
@ -21,6 +21,15 @@ function go_forward() {
|
|||||||
history.forward();
|
history.forward();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function prepare_restore() {
|
||||||
|
if (!document.hidden) {
|
||||||
|
go_back();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener("visibilitychange", go_back);
|
||||||
|
}
|
||||||
|
|
||||||
// there are three states
|
// there are three states
|
||||||
// default: register focus listener,
|
// default: register focus listener,
|
||||||
// on focus: go back and switch to the state forward
|
// on focus: go back and switch to the state forward
|
||||||
@ -38,17 +47,14 @@ switch (history.state) {
|
|||||||
go_forward();
|
go_forward();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!document.hidden) {
|
setTimeout(prepare_restore, 1000);
|
||||||
go_back();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener("visibilitychange", go_back);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<noscript><p>Javascript isn't enabled. So you need to manually go back in history to restore this tab.</p></noscript>
|
<noscript><p>Javascript isn't enabled. So you need to manually go back in history to restore this tab.</p></noscript>
|
||||||
<p>If you see this site something went wrong, or you reached the end of the history, or you disabled javascript.</p>
|
<p>Loading suspended page...<br>
|
||||||
|
<br>
|
||||||
|
If nothing happens, something went wrong or you disabled JavaScript.</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user