Improve popup menu positioning script
This commit is contained in:
parent
d3ae72b305
commit
b24e7b306c
2
js/application.min.js
vendored
2
js/application.min.js
vendored
File diff suppressed because one or more lines are too long
8
js/complete.min.js
vendored
8
js/complete.min.js
vendored
File diff suppressed because one or more lines are too long
2
js/utility.min.js
vendored
2
js/utility.min.js
vendored
File diff suppressed because one or more lines are too long
@ -2039,12 +2039,14 @@ function fcn_popupPosition() {
|
||||
}
|
||||
|
||||
// Left/Right?
|
||||
if (collision.includes('left')) {
|
||||
element.classList.remove('_center', '_justify-right');
|
||||
element.classList.add('_justify-left');
|
||||
} else if(collision.includes('right')) {
|
||||
element.classList.remove('_center', '_justify-left');
|
||||
element.classList.add('_justify-right');
|
||||
if (!element.closest('._fixed-horizontal')) {
|
||||
if (collision.includes('left')) {
|
||||
element.classList.remove('_center', '_justify-right');
|
||||
element.classList.add('_justify-left');
|
||||
} else if(collision.includes('right')) {
|
||||
element.classList.remove('_center', '_justify-left');
|
||||
element.classList.add('_justify-right');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -823,11 +823,11 @@ function fcn_detectScreenCollision(element) {
|
||||
result.push('bottom');
|
||||
}
|
||||
|
||||
if (rect.left <= 50) {
|
||||
if (rect.left <= 10) {
|
||||
result.push('left');
|
||||
}
|
||||
|
||||
if (rect.right >= viewportWidth - 50) {
|
||||
if (rect.right >= viewportWidth - 10) {
|
||||
result.push('right');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user