Merge pull request #115 from Ducz0r/lm-deleting-comments-fix

Fix for deleting comments
This commit is contained in:
Luka Murn 2016-08-30 13:15:35 +02:00 committed by GitHub
commit c6e575bd2a
2 changed files with 14 additions and 1 deletions

View file

@ -1,6 +1,20 @@
function initCommentOptions(scrollableContainer, useParentOffset = true) { function initCommentOptions(scrollableContainer, useParentOffset = true) {
scrollCommentOptions($(".dropdown-comment"), useParentOffset); scrollCommentOptions($(".dropdown-comment"), useParentOffset);
// Reposition dropdown to the left
// (only do this when using parent offset)
if (useParentOffset) {
$(document).on("shown.bs.dropdown", ".dropdown-comment", function() {
var $el = $(this);
var menu = $el.find(".dropdown-menu");
var leftPos = $el.offset().left;
if (leftPos + menu.width() > $(window).width()) {
menu.offset({ left: leftPos - menu.width() });
}
});
}
// Reposition dropdowns vertically on scroll events
document.addEventListener('scroll', function (event) { document.addEventListener('scroll', function (event) {
var $target = $(event.target); var $target = $(event.target);
var parent = $(scrollableContainer); var parent = $(scrollableContainer);

View file

@ -359,7 +359,6 @@ function initStepCommentForm(ev, $el) {
var $form = $el.find("ul form"); var $form = $el.find("ul form");
var $commentInput = $form.find("#comment_message"); var $commentInput = $form.find("#comment_message");
$form.onSubmitValidator(textValidator, $commentInput);
$(".help-block", $form).addClass("hide"); $(".help-block", $form).addClass("hide");