Display mobile reaction box only once
This commit is contained in:
parent
1b8d61f44c
commit
5b918606fa
1 changed files with 7 additions and 2 deletions
|
|
@ -20,6 +20,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function toggleComments(toggleReactionsLink) {
|
function toggleComments(toggleReactionsLink) {
|
||||||
|
if(toggleReactionsLink.hasClass("loading")) { return; }
|
||||||
if (toggleReactionsLink.hasClass("active")) {
|
if (toggleReactionsLink.hasClass("active")) {
|
||||||
hideComments(toggleReactionsLink);
|
hideComments(toggleReactionsLink);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -48,21 +49,25 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLoadedComments(toggleReactionsLink, existingCommentsContainer, commentActionLink) {
|
function showLoadedComments(toggleReactionsLink, existingCommentsContainer, commentActionLink) {
|
||||||
|
toggleReactionsLink.addClass("active");
|
||||||
existingCommentsContainer.show();
|
existingCommentsContainer.show();
|
||||||
showCommentBox(commentActionLink);
|
showCommentBox(commentActionLink);
|
||||||
toggleReactionsLink.addClass("active");
|
|
||||||
existingCommentsContainer.find("time.timeago").timeago();
|
existingCommentsContainer.find("time.timeago").timeago();
|
||||||
}
|
}
|
||||||
|
|
||||||
function showUnloadedComments(toggleReactionsLink, bottomBar, commentActionLink) {
|
function showUnloadedComments(toggleReactionsLink, bottomBar, commentActionLink) {
|
||||||
|
toggleReactionsLink.addClass("loading");
|
||||||
var commentsContainer = commentsContainerLazy(bottomBar);
|
var commentsContainer = commentsContainerLazy(bottomBar);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: toggleReactionsLink.attr("href"),
|
url: toggleReactionsLink.attr("href"),
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
toggleReactionsLink.addClass("active").removeClass("loading");
|
||||||
$(data).insertAfter(bottomBar.children(".show_comments").first());
|
$(data).insertAfter(bottomBar.children(".show_comments").first());
|
||||||
showCommentBox(commentActionLink);
|
showCommentBox(commentActionLink);
|
||||||
toggleReactionsLink.addClass("active");
|
|
||||||
commentsContainer().find("time.timeago").timeago();
|
commentsContainer().find("time.timeago").timeago();
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
toggleReactionsLink.removeClass("loading");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue