mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 06:56:54 +08:00
Merge pull request #115 from Ducz0r/lm-deleting-comments-fix
Fix for deleting comments
This commit is contained in:
commit
c6e575bd2a
2 changed files with 14 additions and 1 deletions
|
@ -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);
|
||||||
|
|
|
@ -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");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue