Permalink
Browse files

livereload: Fix recently broken window.location.reload logic

Closes #4100
  • Loading branch information...
bep committed Nov 18, 2017
1 parent 503ca6d commit d99db71ab5a90246dce729ca802e4cd88b01ba3c
Showing with 4 additions and 2 deletions.
  1. +4 −2 livereload/livereload.go
View
@@ -163,11 +163,13 @@ HugoReload.prototype.reload = function(path, options) {
}
path = path.substring(prefix.length);
var portChanged = options.overrideURL && options.overrideURL != window.location.port
if (!options.overrideURL && window.location.pathname === path) {
if (!portChanged && window.location.pathname === path) {
window.location.reload();
} else {
if (options.overrideURL) {
if (portChanged) {
window.location = location.protocol + "//" + location.hostname + ":" + options.overrideURL + path;
} else {
window.location.pathname = path;

0 comments on commit d99db71

Please sign in to comment.