mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-14 10:53:01 +08:00
Added check if no comments are present for file result, which caused JS error.
This commit is contained in:
parent
303cb4308a
commit
0317872bc0
1 changed files with 18 additions and 17 deletions
|
@ -12,23 +12,24 @@
|
||||||
} else if ( $(".result-comment") && $(".result-comment").length > 0 ) {
|
} else if ( $(".result-comment") && $(".result-comment").length > 0 ) {
|
||||||
comments = $(".result-comment");
|
comments = $(".result-comment");
|
||||||
}
|
}
|
||||||
$.each(comments, function(){
|
if(!_.isUndefined(comments)) {
|
||||||
var that = $(this);
|
$.each(comments, function(){
|
||||||
var link = that.attr("data-href");
|
var that = $(this);
|
||||||
$.ajax({ method: 'GET',
|
var link = that.attr('data-href');
|
||||||
url: link,
|
$.ajax({ method: 'GET',
|
||||||
beforeSend: animateSpinner(that, true) })
|
url: link,
|
||||||
.done(function(data) {
|
beforeSend: animateSpinner(that, true) })
|
||||||
that.html(data.html);
|
.done(function(data) {
|
||||||
initCommentForm(that);
|
that.html(data.html);
|
||||||
initCommentsLink(that);
|
initCommentForm(that);
|
||||||
scrollBottom(that.find(".content-comments"));
|
initCommentsLink(that);
|
||||||
animateSpinner(that, false);
|
scrollBottom(that.find('.content-comments'));
|
||||||
})
|
})
|
||||||
.always(function() {
|
.always(function() {
|
||||||
animateSpinner(that, false);
|
animateSpinner(that, false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// scroll to the botttom
|
// scroll to the botttom
|
||||||
|
|
Loading…
Reference in a new issue