From a967d4dfba292ee15f5a490e98495e35f27b1ffb Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 15 Oct 2014 14:42:18 -0400 Subject: [PATCH] FIX: Support popState on static 404 page --- app/views/exceptions/not_found.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/exceptions/not_found.html.erb b/app/views/exceptions/not_found.html.erb index b9268d3495..ca44c1d80e 100644 --- a/app/views/exceptions/not_found.html.erb +++ b/app/views/exceptions/not_found.html.erb @@ -41,5 +41,11 @@ document.getElementById('google-query').value = 'site:<%= local_domain %> ' + searchValue; return true; } + + window.onpopstate = function(event) { + if (!window.hasOwnProperty("Discourse")) { //check if Discourse object exists if not take care of back navigation + window.location = document.location; + } + }; <%- end %>