mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 03:46:39 +08:00
fixed comments action on project page
This commit is contained in:
parent
bca3d19562
commit
b0f6b1f4d0
2 changed files with 10 additions and 5 deletions
|
@ -170,7 +170,7 @@ var Comments = (function() {
|
||||||
} else {
|
} else {
|
||||||
useParentOffset = true;
|
useParentOffset = true;
|
||||||
}
|
}
|
||||||
scrollCommentOptions($('.dropdown-comment'));
|
scrollCommentOptions($('.dropdown-comment'), useParentOffset);
|
||||||
|
|
||||||
// Reposition dropdown to the left
|
// Reposition dropdown to the left
|
||||||
// (only do this when using parent offset)
|
// (only do this when using parent offset)
|
||||||
|
@ -191,15 +191,20 @@ var Comments = (function() {
|
||||||
var parent = $(scrollableContainer);
|
var parent = $(scrollableContainer);
|
||||||
|
|
||||||
if ($target.length) {
|
if ($target.length) {
|
||||||
scrollCommentOptions(parent.find('.dropdown-comment'));
|
scrollCommentOptions(parent.find('.dropdown-comment'), useParentOffset);
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollCommentOptions(selector) {
|
function scrollCommentOptions(selector, useParentOffset) {
|
||||||
|
if ( ! _.isUndefined(typeof useParentOffset) ) {
|
||||||
|
useParentOffset = useParentOffset;
|
||||||
|
} else {
|
||||||
|
useParentOffset = true;
|
||||||
|
}
|
||||||
_.each(selector, function(el) {
|
_.each(selector, function(el) {
|
||||||
var $el = $(el);
|
var $el = $(el);
|
||||||
var offset = $el.offset().top;
|
var offset = useParentOffset ? $el.offset().top : $el.position().top;
|
||||||
$el.find('.dropdown-menu-fixed')
|
$el.find('.dropdown-menu-fixed')
|
||||||
.offset({ top: (offset + 20) });
|
.offset({ top: (offset + 20) });
|
||||||
});
|
});
|
||||||
|
|
|
@ -284,7 +284,7 @@
|
||||||
initNewProjectModal();
|
initNewProjectModal();
|
||||||
initEditProjectModal();
|
initEditProjectModal();
|
||||||
initManageUsersModal();
|
initManageUsersModal();
|
||||||
Comments.initCommentOptions("ul.content-comments");
|
Comments.initCommentOptions("ul.content-comments", true);
|
||||||
Comments.initEditComments(".panel-project .tab-content");
|
Comments.initEditComments(".panel-project .tab-content");
|
||||||
Comments.initDeleteComments(".panel-project .tab-content");
|
Comments.initDeleteComments(".panel-project .tab-content");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue