focus on our post if posted
This commit is contained in:
parent
23b4f11e6d
commit
c951473310
@ -46,7 +46,7 @@ var reloadImg = function(el) {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
var reloadThreadJSON = function() {
|
var reloadThreadJSON = function(ourPost) {
|
||||||
var url = window.location.pathname + "/json";
|
var url = window.location.pathname + "/json";
|
||||||
var ajax = new XMLHttpRequest();
|
var ajax = new XMLHttpRequest();
|
||||||
ajax.onreadystatechange = function() {
|
ajax.onreadystatechange = function() {
|
||||||
@ -65,6 +65,10 @@ var reloadThreadJSON = function() {
|
|||||||
e.innerHTML = posts[idx].PostMarkup;
|
e.innerHTML = posts[idx].PostMarkup;
|
||||||
rootelem.appendChild(e.childNodes[0]);
|
rootelem.appendChild(e.childNodes[0]);
|
||||||
e.remove();
|
e.remove();
|
||||||
|
if(ourPost && posts[idx].Message_id == ourPost) {
|
||||||
|
// focus on our post
|
||||||
|
window.location.href = window.location.href.replace("#", "") + "#"+id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -135,7 +139,7 @@ onready(function() {
|
|||||||
if (img) {
|
if (img) {
|
||||||
reloadImg(img);
|
reloadImg(img);
|
||||||
}
|
}
|
||||||
reloadThreadJSON();
|
reloadThreadJSON(j.message_id);
|
||||||
} else {
|
} else {
|
||||||
// do redirect
|
// do redirect
|
||||||
window.location.pathname = j.url;
|
window.location.pathname = j.url;
|
||||||
|
Reference in New Issue
Block a user