mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
refactor vertical pos
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user