[DE PE SSE] Fix menu position when left < 0 for RTL
This commit is contained in:
parent
c887caad83
commit
037cb0d926
|
@ -657,14 +657,19 @@ define([
|
||||||
var left = offset.left - posMenu[m[1]][0] + posParent[m[2]][0] + this.offset[0];
|
var left = offset.left - posMenu[m[1]][0] + posParent[m[2]][0] + this.offset[0];
|
||||||
var top = offset.top - posMenu[m[1]][1] + posParent[m[2]][1] + this.offset[1];
|
var top = offset.top - posMenu[m[1]][1] + posParent[m[2]][1] + this.offset[1];
|
||||||
|
|
||||||
if (left + menuW > docW)
|
if (left + menuW > docW) {
|
||||||
if (menuParent.is('li.dropdown-submenu')) {
|
if (menuParent.is('li.dropdown-submenu')) {
|
||||||
left = offset.left - menuW + 2;
|
left = offset.left - menuW + 2;
|
||||||
} else {
|
} else {
|
||||||
left = docW - menuW;
|
left = docW - menuW;
|
||||||
}
|
}
|
||||||
if (left < 0)
|
} else if (left < 0) {
|
||||||
left = 0;
|
if (menuParent.is('li.dropdown-submenu')) {
|
||||||
|
left = offset.left + parentW - 2;
|
||||||
|
} else {
|
||||||
|
left = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.options.restoreHeightAndTop) { // can change top position, if top<0 - then change menu height
|
if (this.options.restoreHeightAndTop) { // can change top position, if top<0 - then change menu height
|
||||||
var cg = Common.Utils.croppedGeometry();
|
var cg = Common.Utils.croppedGeometry();
|
||||||
|
@ -1163,12 +1168,19 @@ define([
|
||||||
var left = offset.left - posMenu[m[1]][0] + posParent[m[2]][0] + this.offset[0];
|
var left = offset.left - posMenu[m[1]][0] + posParent[m[2]][0] + this.offset[0];
|
||||||
var top = offset.top - posMenu[m[1]][1] + posParent[m[2]][1] + this.offset[1];
|
var top = offset.top - posMenu[m[1]][1] + posParent[m[2]][1] + this.offset[1];
|
||||||
|
|
||||||
if (left + menuW > docW)
|
if (left + menuW > docW) {
|
||||||
if (menuParent.is('li.dropdown-submenu')) {
|
if (menuParent.is('li.dropdown-submenu')) {
|
||||||
left = offset.left - menuW + 2;
|
left = offset.left - menuW + 2;
|
||||||
} else {
|
} else {
|
||||||
left = docW - menuW;
|
left = docW - menuW;
|
||||||
}
|
}
|
||||||
|
} else if (left < 0) {
|
||||||
|
if (menuParent.is('li.dropdown-submenu')) {
|
||||||
|
left = offset.left + parentW - 2;
|
||||||
|
} else {
|
||||||
|
left = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.options.restoreHeight) {
|
if (this.options.restoreHeight) {
|
||||||
if (typeof (this.options.restoreHeight) == "number") {
|
if (typeof (this.options.restoreHeight) == "number") {
|
||||||
|
|
Loading…
Reference in a new issue