refactor vertical pos

This commit is contained in:
nikita_bartoshuk
2025-08-31 23:51:35 +03:00
parent a72cfbe9e9
commit bb0a974bc5
2 changed files with 5 additions and 10 deletions

View File

@ -1205,7 +1205,7 @@ class MainController extends Component {
boxSdk.append(dropdownListTarget);
}
if (y > boxSdk.height()) {
y -= y - boxSdk.height()
y = boxSdk.height();
}
dropdownListTarget.css({left: `${x}px`, top: `${y}px`});
Common.Notifications.trigger('openFormImageListTablet', obj, x, y, boxSdk.height(), 260);

View File

@ -21,18 +21,13 @@ class AddFormImageController extends Component {
this.openModalPhone(obj);
});
Common.Notifications.on('openFormImageListTablet', (obj, x, y, boxHeight, formImageHeight) => {
this.openModalTablet(obj, x, y, boxHeight, formImageHeight);
Common.Notifications.on('openFormImageListTablet', (obj, x, y, boxHeight, popoverHeight) => {
this.openModalTablet(obj, x, y, boxHeight, popoverHeight);
});
}
openModalTablet(obj, x, y, boxHeight, formImageHeight) {
let vertPos
if ((boxHeight - y > 0) && boxHeight - y >= formImageHeight) {
vertPos = 'bottom'
} else {
vertPos = 'top'
}
openModalTablet(obj, x, y, boxHeight, popoverHeight) {
let vertPos = (boxHeight - y > 0) && (boxHeight - y >= popoverHeight) ? 'bottom' : 'top'
this.setState({
isOpen: true,