From 88cb94d44efdb0c2c6d75d26b5360ae9001edf0a Mon Sep 17 00:00:00 2001 From: "fly.dvorkin" Date: Fri, 7 Sep 2012 09:52:45 +0000 Subject: [PATCH] r454 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Исправление косяка отобрашения всплывающих суб-меню в Chrome git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@454 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/misc/js/main.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/upload/misc/js/main.js b/upload/misc/js/main.js index 54f3e3995..927bb4788 100644 --- a/upload/misc/js/main.js +++ b/upload/misc/js/main.js @@ -244,8 +244,23 @@ var Menu = { setLocation: function() { var CSS = this.$root.offset(); CSS.top += this.$root.height() + this.offsetCorrection_Y; + var curTop = parseInt(CSS.top); + var tCorner = $(document).scrollTop() + $(window).height() - 20; + var maxVisibleTop = Math.min(curTop, Math.max(0, tCorner - this.$menu.height())); + if (curTop != maxVisibleTop) { + CSS.top = maxVisibleTop; + } CSS.left += this.offsetCorrection_X; + var curLeft = parseInt(CSS.left); + var rCorner = $(document).scrollLeft() + $(window).width() - 6; + var maxVisibleLeft = Math.min(curLeft, Math.max(0, rCorner - this.$menu.width())); + if (curLeft != maxVisibleLeft) { + CSS.left = maxVisibleLeft; + } this.$menu.css(CSS); + if (this.iframeFix) { + $('iframe.ie-fix-select-overlap', $menu).css({ width: $menu.width(), height: $menu.height() }); + } }, fixLocation: function() { @@ -287,7 +302,7 @@ var Menu = { showClickedMenu: function() { this.setLocation(); this.$menu.css({display: 'block'}); - this.fixLocation(); + // this.fixLocation(); this.activeMenuId = this.clickedMenuId; },