refactor back button
This commit is contained in:
parent
89cb8937a9
commit
cf954e0f47
8
main.js
8
main.js
|
@ -1196,6 +1196,10 @@ function initshortcuts()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addfakehistory()
|
||||||
|
{
|
||||||
|
history.pushState({}, '', '.');
|
||||||
|
}
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
loadsettings();
|
loadsettings();
|
||||||
|
@ -1204,10 +1208,10 @@ function init()
|
||||||
window.onbeforeunload = checksaved;
|
window.onbeforeunload = checksaved;
|
||||||
window.onclick = focuseditor;
|
window.onclick = focuseditor;
|
||||||
|
|
||||||
history.pushState({}, '', '.');
|
addfakehistory();
|
||||||
window.onpopstate = function(evt)
|
window.onpopstate = function(evt)
|
||||||
{
|
{
|
||||||
history.pushState({}, '', '.');
|
addfakehistory();
|
||||||
if (!searchdialog.hidden)
|
if (!searchdialog.hidden)
|
||||||
{
|
{
|
||||||
esc(evt);
|
esc(evt);
|
||||||
|
|
Loading…
Reference in New Issue