Fixed issue with menu overflowing on the top

This commit is contained in:
Andreas Stöckel 2011-04-23 09:24:11 +00:00
parent fcaef1ee58
commit eab7a5fdcc
2 changed files with 2242 additions and 2237 deletions

File diff suppressed because one or more lines are too long

View File

@ -383,6 +383,10 @@ function dhtmlXMenuObject(baseId, skin) {
} }
if (y+h > my && this.menuY2 != null) { if (y+h > my && this.menuY2 != null) {
y = srcY + srcH - h + 2; y = srcY + srcH - h + 2;
if (y < 2) {
// Don't let the menu overflow at the top
y = 2;
}
// open from top level // open from top level
if (this.itemPull[id] != null && !this.context) { if (this.itemPull[id] != null && !this.context) {
if (this.itemPull[id]["parent"] == this.idPrefix+this.topId) y = y - this.base.offsetHeight; if (this.itemPull[id]["parent"] == this.idPrefix+this.topId) y = y - this.base.offsetHeight;
@ -829,6 +833,7 @@ dhtmlXMenuObject.prototype._countVisiblePolygonItems = function(id) {
var count = 0; var count = 0;
// console.log(this.idPull) // console.log(this.idPull)
for (var a in this.itemPull) { for (var a in this.itemPull) {
//console.log(a) //console.log(a)
var par = this.itemPull[a]["parent"]; var par = this.itemPull[a]["parent"];
var tp = this.itemPull[a]["type"]; var tp = this.itemPull[a]["type"];