extract inline `onpopstate` handler on 404 page (#6613)
This commit is contained in:
parent
f0760908e3
commit
5f754b43f1
|
@ -0,0 +1,6 @@
|
|||
window.onpopstate = function(event) {
|
||||
// check if Discourse object exists if not take care of back navigation
|
||||
if (event.state && !window.hasOwnProperty("Discourse")) {
|
||||
window.location = document.location;
|
||||
}
|
||||
};
|
|
@ -38,11 +38,5 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script language="Javascript">
|
||||
window.onpopstate = function(event) {
|
||||
if (event.state && !window.hasOwnProperty("Discourse")) { //check if Discourse object exists if not take care of back navigation
|
||||
window.location = document.location;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<%= preload_script('onpopstate-handler') %>
|
||||
<%- end %>
|
||||
|
|
|
@ -128,6 +128,7 @@ module Discourse
|
|||
activate-account.js
|
||||
auto-redirect.js
|
||||
wizard-start.js
|
||||
onpopstate-handler.js
|
||||
}
|
||||
|
||||
# Precompile all available locales
|
||||
|
|
Loading…
Reference in New Issue