diff --git a/kallithea/templates/files/files.html b/kallithea/templates/files/files.html
--- a/kallithea/templates/files/files.html
+++ b/kallithea/templates/files/files.html
@@ -215,6 +215,8 @@ $(document).ready(function(){
window.addEventListener('popstate', function(e){
if (e.state)
load_state(e.state);
+ else
+ load_state(initial_state);
});
// init the search filter
@@ -222,6 +224,9 @@ $(document).ready(function(){
var _url_base = url_base.replace('__REV__', ${h.js(c.changeset.raw_id)});
fileBrowserListeners(_node_list_url, _url_base);
+ var initial_state = {url:window.location.href, title:document.title, url_base:_url_base,
+ node_list_url:_node_list_url, rev:${h.js(c.changeset.raw_id)}, f_path:${h.js(h.safe_unicode(c.file.path))}};
+
// change branch filter
$("#branch_selector").select2({
dropdownAutoWidth: true,