Author: Alex.Kolonitsky
Date: 2009-07-14 04:29:06 -0400 (Tue, 14 Jul 2009)
New Revision: 14914
Modified:
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
Log:
toolTip: if direction="auto" toolTip has not appeared
https://jira.jboss.org/jira/browse/RF-7506
Modified:
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
---
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2009-07-14
08:24:35 UTC (rev 14913)
+++
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2009-07-14
08:29:06 UTC (rev 14914)
@@ -50,6 +50,9 @@
public class ToolTipRenderer extends AjaxComponentRendererBase {
+ private static final String DIRECTION_AUTO = "auto";
+ private static final String DIRECTION_BOTTOM_RIGHT = "bottom-right";
+
private static final String AJAX_MODE = "ajax";
private final InternetResource[] styles = {
getResource("/org/richfaces/renderkit/html/css/tooltip.xcss") };
@@ -283,7 +286,11 @@
utils.addToScriptHash(options, "onshow", showFunc);
utils.addToScriptHash(options, "disabled", toolTip.isDisabled(),
"false");
- utils.addToScriptHash(options, "direction", toolTip.getDirection(),
"bottom-right");
+ String direction = toolTip.getDirection();
+ if (DIRECTION_AUTO.equalsIgnoreCase(direction)) {
+ direction = DIRECTION_BOTTOM_RIGHT;
+ }
+ utils.addToScriptHash(options, "direction", direction,
DIRECTION_BOTTOM_RIGHT);
utils.addToScriptHash(options, "followMouse", toolTip.isFollowMouse(),
"false");
utils.addToScriptHash(options, "horizontalOffset",
toolTip.getHorizontalOffset(), "10");
utils.addToScriptHash(options, "verticalOffset",
toolTip.getVerticalOffset(), "10");