From 44b25e3eaa58d2b1774241ee8952e101276d058e Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 28 Jun 2010 17:02:26 -0400 Subject: [PATCH] DG IZ; fixed javascript bug. stream fades in recents again. --- app/views/layouts/application.html.haml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index a6fde39ea..399d69c06 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -30,17 +30,16 @@ ws = new WebSocket("ws://#{request.host}:8080/"); ws.onmessage = function(evt) { var obj = jQuery.parseJSON(evt.data); - if((location.href.indexOf(obj['class']) != -1 ) || (location.pathname == '/')) { - $("#stream").prepend($(obj['html']).fadeIn("fast")); - }; - } - ws.onclose = function() { debug("socket closed"); }; - ws.onopen = function() { - ws.send(location.pathname); - debug("connected..."); - }; + if((location.href.indexOf(obj['class']) != -1 ) || (location.pathname == '/')) { + $("#stream").prepend($(obj['html']).fadeIn("fast")); + }; + }; + ws.onclose = function() { debug("socket closed"); }; + ws.onopen = function() { + ws.send(location.pathname); + debug("connected..."); + }; }); - }); %body - flash.each do |name, msg| = content_tag :div, msg, :id => "flash_#{name}"