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()
|
||||
{
|
||||
loadsettings();
|
||||
|
@ -1204,10 +1208,10 @@ function init()
|
|||
window.onbeforeunload = checksaved;
|
||||
window.onclick = focuseditor;
|
||||
|
||||
history.pushState({}, '', '.');
|
||||
addfakehistory();
|
||||
window.onpopstate = function(evt)
|
||||
{
|
||||
history.pushState({}, '', '.');
|
||||
addfakehistory();
|
||||
if (!searchdialog.hidden)
|
||||
{
|
||||
esc(evt);
|
||||
|
|
Loading…
Reference in New Issue