From 91b0ff67791970082d97b5a92a29004f0f4483f6 Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Fri, 15 Jan 2010 14:17:17 +0300 Subject: [PATCH] - bugfix: negaive x- and y- offsets of context submenu --- src/ajax.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ajax.js b/src/ajax.js index 4d6e56b..2b1337a 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -1259,8 +1259,10 @@ function mttMenu(container, options) var offset = this.$caller.offset(); var x = offset.left+this.$caller.outerWidth(); if(x + this.container.outerWidth(true) > $(window).width() + $(document).scrollLeft()) x = offset.left - this.container.outerWidth() - 1; + if(x<0) x=0; var y = offset.top + this.parent.container.offset().top-this.parent.container.find('li:first').offset().top; if(y + this.container.outerHeight(true) > $(window).height() + $(document).scrollTop()) y = $(window).height() + $(document).scrollTop()- this.container.outerHeight(true) - 1; + if(y<0) y=0; this.container.css({ position: 'absolute', top: y, left: x /*, 'min-width': this.$caller.outerWidth()*/ }).show(); this.menuOpen = true; }