mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-01 09:24:59 +08:00
fixed comment options dropdown position
This commit is contained in:
parent
d90f17d1eb
commit
bca3d19562
1 changed files with 5 additions and 11 deletions
|
@ -170,7 +170,7 @@ var Comments = (function() {
|
||||||
} else {
|
} else {
|
||||||
useParentOffset = true;
|
useParentOffset = true;
|
||||||
}
|
}
|
||||||
scrollCommentOptions($('.dropdown-comment'), useParentOffset);
|
scrollCommentOptions($('.dropdown-comment'));
|
||||||
|
|
||||||
// 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,22 +191,17 @@ var Comments = (function() {
|
||||||
var parent = $(scrollableContainer);
|
var parent = $(scrollableContainer);
|
||||||
|
|
||||||
if ($target.length) {
|
if ($target.length) {
|
||||||
scrollCommentOptions(parent.find('.dropdown-comment'), useParentOffset);
|
scrollCommentOptions(parent.find('.dropdown-comment'));
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollCommentOptions(selector, useParentOffset) {
|
function scrollCommentOptions(selector) {
|
||||||
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 = useParentOffset ? $el.offset().top : $el.position().top;
|
var offset = $el.offset().top;
|
||||||
$el.find('.dropdown-menu-fixed')
|
$el.find('.dropdown-menu-fixed')
|
||||||
.offset({ top: (offset + 20) });
|
.offset({ top: (offset + 20) });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +332,6 @@ var Comments = (function() {
|
||||||
form: initCommentForm,
|
form: initCommentForm,
|
||||||
bindNewElement: bindCommentInitializerToNewElement,
|
bindNewElement: bindCommentInitializerToNewElement,
|
||||||
initCommentOptions: initCommentOptions,
|
initCommentOptions: initCommentOptions,
|
||||||
scrollCommentOptions: scrollCommentOptions,
|
|
||||||
initDeleteComments: initDeleteComments,
|
initDeleteComments: initDeleteComments,
|
||||||
initEditComments: initEditComments
|
initEditComments: initEditComments
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue