diff options
author | Bjørn Erik Pedersen <[email protected]> | 2017-11-18 10:54:07 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2017-11-18 10:54:07 +0100 |
commit | d99db71ab5a90246dce729ca802e4cd88b01ba3c (patch) | |
tree | 0e7b0120206fdf8f6aebb00d9f426a8f40ed61c7 /livereload | |
parent | 503ca6de6ceb0b4af533f9efeff917d6f3871278 (diff) | |
download | hugo-d99db71ab5a90246dce729ca802e4cd88b01ba3c.tar.gz hugo-d99db71ab5a90246dce729ca802e4cd88b01ba3c.zip |
livereload: Fix recently broken window.location.reload logic
Closes #4100
Diffstat (limited to 'livereload')
-rw-r--r-- | livereload/livereload.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/livereload/livereload.go b/livereload/livereload.go index 90096577d..7bfbbaf6b 100644 --- a/livereload/livereload.go +++ b/livereload/livereload.go @@ -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; |