Permalink
Browse files

randomly change the percent down

  • Loading branch information...
1 parent 0c06bb6 commit 9045ab671cbd799b51f8a946cfd6e24303d32d5e @jedahan jedahan committed Sep 9, 2011
Showing with 4 additions and 3 deletions.
  1. +3 −2 src/public/scripts/lepidoptera.coffee
  2. +1 −1 src/public/stylesheets/screen.css
@@ -44,12 +44,12 @@ lepidoptera = ->
updateFeed = (resource_id, body) ->
data = JSON.parse body.data
+ down = Math.random() < .5
- console.log "updateFeed(#{resource_id},#{JSON.stringify data})"
+ console.log "updateFeed(#{resource_id},#{JSON.stringify data}, #{down})"
dom_name = $("##{resource_id} > .car_name")
dom_name.html(data.car_name) if dom_name[0]?
-
for feed in config.feeds
# if the feed doesn't exist, add it
dom_feed = $("##{resource_id} > .feeds > .#{feed.name}")
@@ -59,6 +59,7 @@ lepidoptera = ->
# replace the inner html with the new mpg data
dom_feed.find(".data").html "#{data[feed.name]}"
+ dom_feed.toggleClass('down', down)
# see if we have a marker on the map for this resource
for m in markers
@@ -235,7 +235,7 @@ html, body {
height:15px;
}
-#content #sidebar #resources .resource .feeds .feed.change.down .icion_wrapper {
+#content #sidebar #resources .resource .feeds .feed.change.down .icon_wrapper {
background-image:url("../images/icon-arrow-down.png");
}

0 comments on commit 9045ab6

Please sign in to comment.