mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Merge pull request #212 from okriuchykhin/ok_SCI_530
Fixes issue with comments options menu [SCI-530]
This commit is contained in:
commit
9a3e531b33
2 changed files with 8 additions and 4 deletions
|
@ -165,7 +165,7 @@ var Comments = (function() {
|
|||
}
|
||||
|
||||
function initCommentOptions(scrollableContainer, useParentOffset) {
|
||||
if ( ! _.isUndefined(typeof useParentOffset) ) {
|
||||
if ( ! _.isUndefined(useParentOffset) ) {
|
||||
useParentOffset = useParentOffset;
|
||||
} else {
|
||||
useParentOffset = true;
|
||||
|
@ -179,8 +179,10 @@ var Comments = (function() {
|
|||
var $el = $(this);
|
||||
var menu = $el.find('.dropdown-menu');
|
||||
var leftPos = $el.offset().left;
|
||||
var parentTopPos = $el.offset().top;
|
||||
if (leftPos + menu.width() > $(window).width()) {
|
||||
menu.offset({ left: leftPos - menu.width() });
|
||||
menu.offset({ left: leftPos - menu.width(),
|
||||
top: (parentTopPos + <%= DROPDOWN_TOP_OFFSET %>)});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -197,7 +199,7 @@ var Comments = (function() {
|
|||
}
|
||||
|
||||
function scrollCommentOptions(selector, useParentOffset) {
|
||||
if ( ! _.isUndefined(typeof useParentOffset) ) {
|
||||
if ( ! _.isUndefined(useParentOffset) ) {
|
||||
useParentOffset = useParentOffset;
|
||||
} else {
|
||||
useParentOffset = true;
|
||||
|
@ -206,7 +208,7 @@ var Comments = (function() {
|
|||
var $el = $(el);
|
||||
var offset = useParentOffset ? $el.offset().top : $el.position().top;
|
||||
$el.find('.dropdown-menu-fixed')
|
||||
.offset({ top: (offset + 20) });
|
||||
.offset({ top: (offset + <%= DROPDOWN_TOP_OFFSET %>) });
|
||||
});
|
||||
}
|
||||
|
|
@ -40,6 +40,8 @@ FILE_MAX_SIZE = 50
|
|||
AVATAR_MAX_SIZE = 0.2
|
||||
# Max characters for text in dropdown list
|
||||
DROPDOWN_TEXT_MAX_LENGTH = 15
|
||||
# Dropdown top offset from the parent
|
||||
DROPDOWN_TOP_OFFSET = 20
|
||||
|
||||
SEARCH_LIMIT = 20
|
||||
|
||||
|
|
Loading…
Reference in a new issue