Fix no redirect after writing a comment

This commit is contained in:
Kijin Sung 2016-03-04 10:57:56 +09:00
parent 1b372375a4
commit 54fc1da600

View file

@ -102,9 +102,18 @@
}
// If the response contains a redirect URL, redirect immediately.
if (result.redirect_url) {
window.location = result.redirect_url.replace(/&/g, "&");
return null;
if (data.redirect_url) {
data.redirect_url = data.redirect_url.replace(/&/g, "&");
if (data.redirect_url.indexOf(window.location.href.replace(/#.+$/, "") + "#") === 0)
{
window.location = data.redirect_url;
window.location.reload();
}
else
{
window.location = data.redirect_url;
}
return;
}
// If there was a success callback, call it.
@ -220,6 +229,21 @@
}
}
// If the response contains a redirect URL, redirect immediately.
if (data.redirect_url) {
data.redirect_url = data.redirect_url.replace(/&/g, "&");
if (data.redirect_url.indexOf(window.location.href.replace(/#.+$/, "") + "#") === 0)
{
window.location = data.redirect_url;
window.location.reload();
}
else
{
window.location = data.redirect_url;
}
return;
}
// If there was a success callback, call it.
if($.isFunction(callback_success)) {
callback_success(data);