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