added more conditional checks for javascripts to reduce computation load

This commit is contained in:
albert
2011-11-02 12:27:40 -04:00
parent 10141af07d
commit 02eac64bd9
20 changed files with 193 additions and 176 deletions

View File

@@ -2,13 +2,15 @@
Danbooru.PostFlag = {};
Danbooru.PostFlag.initialize_all = function() {
this.initialize_flag();
this.hide_or_show_flag_link();
if ($("#c-posts") && $("#a-show")) {
this.initialize_flag();
this.hide_or_show_flag_link();
}
}
Danbooru.PostFlag.hide_or_show_flag_link = function() {
if (Danbooru.meta("post-is-deleted") == "true") {
$("a#flag").hide();
$("#flag").hide();
}
}
@@ -28,7 +30,7 @@
}
});
$("a#flag").click(function(e) {
$("#flag").click(function(e) {
e.preventDefault();
$("#flag-dialog").dialog("open");
});