refactoring views
This commit is contained in:
@@ -50,17 +50,7 @@
|
||||
location.href = domain + "/static/terms_of_service?url=" + location.href;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.get("hide-news-ticker") == "1") {
|
||||
$("#news-ticker").hide();
|
||||
} else {
|
||||
$("#close-news-ticker-link").click(function(e) {
|
||||
$("#news-ticker").hide();
|
||||
Danbooru.Cookie.put("hide-news-ticker", "1", 1);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (this.get("hide-upgrade-account") != "1") {
|
||||
$("#upgrade-account").show();
|
||||
}
|
||||
|
||||
21
app/assets/javascripts/news.js
Normal file
21
app/assets/javascripts/news.js
Normal file
@@ -0,0 +1,21 @@
|
||||
(function() {
|
||||
Danbooru.News = {};
|
||||
|
||||
Danbooru.News.initialize = function() {
|
||||
var key = $("#news-ticker").data("updated-at");
|
||||
|
||||
if (Danbooru.Cookie.get("news-ticker") === key) {
|
||||
$("#news-ticker").hide();
|
||||
} else {
|
||||
$("#close-news-ticker-link").click(function(e) {
|
||||
$("#news-ticker").hide();
|
||||
Danbooru.Cookie.put("news-ticker", key);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
Danbooru.News.initialize();
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user