fix kanban dropdown overflow
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<div>
|
||||
{{#if isFirst}}
|
||||
{{#unless rowActionsDisabled}}
|
||||
<div class="pull-right item-menu-container">{{{../itemMenu}}}</div>
|
||||
<div class="pull-right item-menu-container fix-overflow">{{{../itemMenu}}}</div>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
<div class="form-group">
|
||||
|
||||
+38
-1
@@ -1409,7 +1409,9 @@ class App {
|
||||
* @private
|
||||
*/
|
||||
initDomEventListeners() {
|
||||
$(document).on('keydown.espo.button', e => {
|
||||
const $document = $(document);
|
||||
|
||||
$document.on('keydown.espo.button', e => {
|
||||
if (
|
||||
e.code !== 'Enter' ||
|
||||
e.target.tagName !== 'A' ||
|
||||
@@ -1426,6 +1428,41 @@ class App {
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$document.on('show.bs.dropdown', e => {
|
||||
if (!e.target.parentElement.classList.contains('fix-overflow')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isRight = e.target.classList.contains('pull-right');
|
||||
|
||||
const $ul = $(e.target.parentElement).find('.dropdown-menu');
|
||||
const ul = $ul.get(0);
|
||||
|
||||
const rect = e.target.getBoundingClientRect();
|
||||
|
||||
const parent = $ul.offsetParent().get(0);
|
||||
|
||||
if (!parent) {
|
||||
return;
|
||||
}
|
||||
|
||||
const scrollTop = parent === window.document.documentElement ?
|
||||
(document.documentElement.scrollTop || document.body.scrollTop) :
|
||||
parent.scrollTop;
|
||||
|
||||
const top = rect.top + scrollTop + e.target.getBoundingClientRect().height;
|
||||
|
||||
const left = isRight ?
|
||||
rect.left - $(ul).outerWidth() + rect.width:
|
||||
rect.left
|
||||
|
||||
$ul.css({
|
||||
top: top,
|
||||
left: left,
|
||||
right: 'auto',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,8 +39,6 @@ class KanbanRecordItem extends View {
|
||||
};
|
||||
}
|
||||
|
||||
events = {}
|
||||
|
||||
setup() {
|
||||
this.itemLayout = this.options.itemLayout;
|
||||
this.rowActionsView = this.options.rowActionsView;
|
||||
|
||||
@@ -161,6 +161,12 @@ ul.dropdown-menu-with-icons {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.fix-overflow {
|
||||
.btn-group {
|
||||
position: unset;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
.quick-search-list-item {
|
||||
input {
|
||||
|
||||
Reference in New Issue
Block a user