fixes #1536
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
Danbooru.NewsUpdate = {};
|
Danbooru.NewsUpdate = {};
|
||||||
|
|
||||||
Danbooru.NewsUpdate.initialize = function() {
|
Danbooru.NewsUpdate.initialize = function() {
|
||||||
var key = $("#news-updates").data("updated-at");
|
var key = $("#news-updates").data("id");
|
||||||
|
|
||||||
if (Danbooru.Cookie.get("news-ticker") === key) {
|
if (Danbooru.Cookie.get("news-ticker") === key) {
|
||||||
$("#news-updates").hide();
|
$("#news-updates").hide();
|
||||||
@@ -12,7 +12,8 @@
|
|||||||
Danbooru.Cookie.put("news-ticker", key);
|
Danbooru.Cookie.put("news-ticker", key);
|
||||||
|
|
||||||
// need to reset the more link
|
// 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;
|
return false;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<% cache("news-updates", :expires_in => 1.hour) do %>
|
<% 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>
|
<ul>
|
||||||
<% NewsUpdate.recent.each do |news_update| %>
|
<% NewsUpdate.recent.each do |news_update| %>
|
||||||
<li><%= news_update.created_at.strftime("%b %d") %>: <%= news_update.message.html_safe %></li>
|
<li><%= news_update.created_at.strftime("%b %d") %>: <%= news_update.message.html_safe %></li>
|
||||||
|
|||||||
Reference in New Issue
Block a user