This commit is contained in:
r888888888
2013-05-07 15:52:14 -07:00
parent 4237215dad
commit c8f83f1442
2 changed files with 4 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
Danbooru.NewsUpdate = {};
Danbooru.NewsUpdate.initialize = function() {
var key = $("#news-updates").data("updated-at");
var key = $("#news-updates").data("id");
if (Danbooru.Cookie.get("news-ticker") === key) {
$("#news-updates").hide();
@@ -12,7 +12,8 @@
Danbooru.Cookie.put("news-ticker", key);
// need to reset the more link
$("#more-links").hide().offset({top: $("#site-map-link").offset().top + $("#site-map-link").height() + 10, left: $("#site-map-link").offset().left});
var $site_map_link = $("#site-map-link");
$("#more-links").hide().offset({top: $site_map_link.offset().top + $site_map_link.height() + 10, left: $site_map_link.offset().left});
return false;
});

View File

@@ -1,5 +1,5 @@
<% cache("news-updates", :expires_in => 1.hour) do %>
<div id="news-updates" data-updated-at="<%= NewsUpdate.recent.first.try(:created_at).try(:strftime, "%Y-%m-%d") %>">
<div id="news-updates" data-id="<%= NewsUpdate.recent.first.try(:id) %>">
<ul>
<% NewsUpdate.recent.each do |news_update| %>
<li><%= news_update.created_at.strftime("%b %d") %>: <%= news_update.message.html_safe %></li>