fixed small js bug so it only adds to the base route (or page 1 on pagination)
This commit is contained in:
parent
9631977597
commit
da59078b64
1 changed files with 9 additions and 2 deletions
|
|
@ -12,12 +12,19 @@
|
||||||
var obj = jQuery.parseJSON(evt.data);
|
var obj = jQuery.parseJSON(evt.data);
|
||||||
debug("got a " + obj['class']);
|
debug("got a " + obj['class']);
|
||||||
|
|
||||||
|
|
||||||
|
function onPageOne() {
|
||||||
|
var c = document.location.search.charAt(document.location.search.length-1);
|
||||||
|
return ((c =='') || (c== '1'))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (obj['class']=="comments"){
|
if (obj['class']=="comments"){
|
||||||
var post_id = obj['post_id']
|
var post_id = obj['post_id']
|
||||||
$('#'+ obj['post_id'] + ' .comment_set li:last' ).before(
|
$('#'+ obj['post_id'] + ' .comment_set li:last' ).before(
|
||||||
$(obj['html']).fadeIn("fast", function(){})
|
$(obj['html']).fadeIn("fast", function(){})
|
||||||
)
|
)
|
||||||
}else if((location.href.indexOf(obj['class']) != -1 ) || (location.pathname == '/')) {
|
}else if(((location.href.indexOf(obj['class']) != -1 ) || (location.pathname == '/')) && onPageOne()) {
|
||||||
$("#stream").prepend(
|
$("#stream").prepend(
|
||||||
$(obj['html']).fadeIn("fast", function(){
|
$(obj['html']).fadeIn("fast", function(){
|
||||||
$("#stream label:first").inFieldLabels();
|
$("#stream label:first").inFieldLabels();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue