diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 1fc933a25..bd7818824 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -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();