mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
livereload: Fix recently broken window.location.reload logic
Closes #4100
This commit is contained in:
parent
503ca6de6c
commit
d99db71ab5
1 changed files with 4 additions and 2 deletions
|
@ -163,11 +163,13 @@ HugoReload.prototype.reload = function(path, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
path = path.substring(prefix.length);
|
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();
|
window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
if (options.overrideURL) {
|
if (portChanged) {
|
||||||
window.location = location.protocol + "//" + location.hostname + ":" + options.overrideURL + path;
|
window.location = location.protocol + "//" + location.hostname + ":" + options.overrideURL + path;
|
||||||
} else {
|
} else {
|
||||||
window.location.pathname = path;
|
window.location.pathname = path;
|
||||||
|
|
Loading…
Reference in a new issue