popover fix

This commit is contained in:
Yuri Kuznetsov
2022-08-19 21:22:34 +03:00
parent f65143edf3
commit c226fd7936
3 changed files with 14 additions and 7 deletions
+10 -2
View File
@@ -783,7 +783,7 @@ function (/** marked~ */marked, /** DOMPurify~ */ DOMPurify) {
* @typedef {Object} Espo.Ui~PopoverOptions
*
* @property {'bottom'|'top'} [placement='bottom'] A placement.
* @property {string} [container='body'] A container selector.
* @property {string|JQuery} [container] A container selector.
* @property {string} [content] An HTML content.
* @property {string} [text] A text.
* @property {'manual'|'click'|'hover'|'focus'} [trigger='manual'] A trigger type.
@@ -805,10 +805,18 @@ function (/** marked~ */marked, /** DOMPurify~ */ DOMPurify) {
let content = o.content || Handlebars.Utils.escapeExpression(o.text || '');
let isShown = false;
let container = o.container;
if (!container) {
let $modalBody = $el.closest('.modal-body');
container = $modalBody.length ? $modalBody : 'body';
}
$el
.popover({
placement: o.placement || 'bottom',
container: o.container || 'body',
container: container,
html: true,
content: content,
trigger: o.trigger || 'manual',
@@ -91,7 +91,6 @@ define('views/admin/field-manager/modals/add-field', ['views/modal'], function (
Espo.Ui.popover($el, {
content: text,
placement: 'left',
container: this.$el.find('.modal-body'),
}, this);
});
},
+4 -4
View File
@@ -1335,10 +1335,10 @@ function (Dep, ViewRecordHelper, ActionItemSetup) {
$containers.addClass('stick-sub');
$block.show();
$('.popover').each((i, el) => {
/*$('.popover').each((i, el) => {
let $el = $(el);
$el.css('top', ($el.position().top - blockHeight) + 'px');
});
});*/
}
$navbarRight.addClass('has-sticked-bar');
@@ -1353,10 +1353,10 @@ function (Dep, ViewRecordHelper, ActionItemSetup) {
$navbarRight.removeClass('has-sticked-bar');
$block.hide();
$('.popover').each((i, el) => {
/*$('.popover').each((i, el) => {
let $el = $(el);
$el.css('top', ($el.position().top + blockHeight) + 'px');
});
});*/
}
$containers.show();