app/assets/javascripts/admin/dashboard.js in enki-engine-0.0.4 vs app/assets/javascripts/admin/dashboard.js in enki-engine-0.0.5
- old
+ new
@@ -2,32 +2,34 @@
tokens = obj.attr('id').split('-');
return tokens[tokens.length-1];
}
$(document).ready(function (){
- $('.comment-body').hide();
+ if ($('#recent-comments').length) {
+ $('.comment-body').hide();
- $('.comment-link').click (function() {
- comment_body_id = '#comment-body-' + extractId($(this));
+ $('.comment-link').click(function() {
+ comment_body_id = '#comment-body-' + extractId($(this));
- $('.comment-body').not(comment_body_id).hide();
- $(comment_body_id).toggle();
+ $('.comment-body').not(comment_body_id).hide();
+ $(comment_body_id).toggle();
- return false;
- })
+ return false;
+ });
- $(document).click(function() {
- $('.comment-body').hide();
- });
+ $(document).click(function() {
+ $('.comment-body').hide();
+ });
- asyncUndoBehaviour();
+ asyncUndoBehaviour();
- $('form.delete-item').submit(function () {
- asyncDeleteForm($(this));
+ $('form.delete-item').submit(function () {
+ asyncDeleteForm($(this));
- // Assume success and remove comment
- comment_link_id = '#comment-link-' + extractId($(this));
- $(comment_link_id).remove();
- $(this).parent('div').parent('div').remove();
- return false;
- });
-})
+ // Assume success and remove comment
+ comment_link_id = '#comment-link-' + extractId($(this));
+ $(comment_link_id).remove();
+ $(this).parent('div').parent('div').remove();
+ return false;
+ });
+ }
+});