Author: a.izobov
Date: 2007-06-27 10:44:38 -0400 (Wed, 27 Jun 2007)
New Revision: 1338
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
http://jira.jboss.com/jira/browse/RF-378 fixed
Modified:
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
---
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-06-27
14:33:09 UTC (rev 1337)
+++
trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-06-27
14:44:38 UTC (rev 1338)
@@ -576,9 +576,17 @@
var options = RichFaces.Menu.Layers.layers[this.layer.id].options;
var dir = 0;
+ var vDir = 0;
if (options.direction) {
- dir = options.direction.toUpperCase().indexOf('LEFT')!=-1?1:dir;
- dir = options.direction.toUpperCase().indexOf('RIGHT')!=-1?2:dir;
+ strDirection = options.direction.toUpperCase();
+ dir = strDirection.indexOf('LEFT')!=-1?1:dir;
+ dir = strDirection.indexOf('RIGHT')!=-1?2:dir;
+ if (dir>0) {
+ if (strDirection.indexOf('LEFT-UP')!=-1 ||
+ strDirection.indexOf('RIGHT-UP')!=-1) vDir = 1;
+ if (strDirection.indexOf('LEFT-DOWN')!=-1 ||
+ strDirection.indexOf('RIGHT-DOWN')!=-1) vDir = 2;
+ }
}
var layerLeft = right;
@@ -600,22 +608,26 @@
layerLeft = left - layerdim.width;
}
- if (layerTop + layerdim.height + labelOffset[1] - windowShift.top >= windowHeight)
{
- var invisibleBottom = layerTop + layerdim.height + labelOffset[1] - windowShift.top
- windowHeight;
- var items = this.layer.firstChild.childNodes;
- if (items.length > 1) {
- var lastItem = items[items.length-2];
-// var layerOffset = Position.cumulativeOffset(this.layer);
- var itemOffset = Position.positionedOffset(lastItem);
-// layerTop = top -(itemOffset[1]-layerOffset[1]);
- layerTop = top - itemOffset[1];
- if (layerTop < 0) {
- if (Math.abs(layerTop) > invisibleBottom) layerTop = top;
- }
- }
+ if (vDir != 2) {
+ if (layerTop + layerdim.height + labelOffset[1] - windowShift.top >= windowHeight
+ || vDir == 1) {
+ var invisibleBottom = layerTop + layerdim.height + labelOffset[1] - windowShift.top
- windowHeight;
+ var items = this.layer.firstChild.childNodes;
+ if (items.length > 1) {
+ var lastItem = items[items.length-2];
+ // var layerOffset = Position.cumulativeOffset(this.layer);
+ var itemOffset = Position.positionedOffset(lastItem);
+ // layerTop = top -(itemOffset[1]-layerOffset[1]);
+ layerTop = top - itemOffset[1];
+ if (vDir == 0) {
+ if (layerTop < 0) {
+ if (Math.abs(layerTop) > invisibleBottom) layerTop = top;
+ }
+ }
+ }
+ }
+ }
- }
-
/* if (layerLeft + layerdim.width >= windowWidth) {
layerLeft = left - layerdim.width + RichFaces.Menu.Layers.shadowWidth;
}