fixed small js bug so it only adds to the base route (or page 1 on pagination)

This commit is contained in:
maxwell 2010-06-30 17:49:45 -07:00
parent 9631977597
commit da59078b64

View file

@ -11,13 +11,20 @@
ws.onmessage = function(evt) {
var obj = jQuery.parseJSON(evt.data);
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"){
var post_id = obj['post_id']
$('#'+ obj['post_id'] + ' .comment_set li:last' ).before(
$(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(
$(obj['html']).fadeIn("fast", function(){
$("#stream label:first").inFieldLabels();