mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #166 from ZmagoD/zd_SCI_471
fixes load comments [fixes SCI-471]
This commit is contained in:
commit
2b678998d3
1 changed files with 26 additions and 23 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
|
||||||
|
@ -130,9 +131,10 @@
|
||||||
.change(function() {
|
.change(function() {
|
||||||
$(".step-save")
|
$(".step-save")
|
||||||
.on("click", function() {
|
.on("click", function() {
|
||||||
setTimeout(function() {
|
$(document)
|
||||||
initializeComments();
|
.on('ajax:success', function(){
|
||||||
}, 500);
|
initializeComments();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if ( document.getElementById("results") !== null ) {
|
} else if ( document.getElementById("results") !== null ) {
|
||||||
|
@ -140,9 +142,10 @@
|
||||||
.change(function() {
|
.change(function() {
|
||||||
$(".save-result")
|
$(".save-result")
|
||||||
.on("click", function() {
|
.on("click", function() {
|
||||||
setTimeout(function() {
|
$(document)
|
||||||
initializeComments();
|
.on('ajax:success', function(){
|
||||||
}, 500);
|
initializeComments();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue