Author: sergeyhalipov
Date: 2008-03-17 13:13:51 -0400 (Mon, 17 Mar 2008)
New Revision: 6877
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2428
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss
===================================================================
---
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss 2008-03-17
16:43:30 UTC (rev 6876)
+++
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/css/tooltip.xcss 2008-03-17
17:13:51 UTC (rev 6877)
@@ -14,6 +14,8 @@
<u:style name="font-family" skin="generalFamilyFont"/>
<u:style name="color" skin="generalFontColor"/>
<u:style name="float" value="left"/>
+ <u:style name="position" value="absolute"/>
+ <u:style name="display" value="none"/>
</u:selector>
</f:template>
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
---
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2008-03-17
16:43:30 UTC (rev 6876)
+++
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2008-03-17
17:13:51 UTC (rev 6877)
@@ -40,6 +40,7 @@
this.id = id;
this.parentId = parentId;
+ this.parent = $(this.parentId);
this.mode = mode;
this.direction = direction;
this.disabled = disabled;
@@ -110,33 +111,7 @@
this.toolTip.component = null;
}
- if (!this.parentAttached)
- {
- if (!this.disabled) Event.stopObserving(document, "mousemove",
this.attachOnLoadEventsListner, true);
- }
- else
- {
- if (this.followMouse) Event.stopObserving(this.parent, 'mousemove',
this.setToolTipPositionListner, false);
-
- Event.stopObserving(this.parent, this.event, this.doShowListner, false);
-
- if (this.showEvent != "focus") {
- if(this.hideEvent != null){
- Event.stopObserving(this.parent, this.hideEvent, this.doHideListner, false);
- Event.stopObserving(this.toolTip, this.hideEvent, this.leaveToolTipListner,
false);
- }else{
- Event.stopObserving(this.parent, "mouseout", this.doHideListner, false);
- Event.stopObserving(this.toolTip,"mouseout", this.leaveToolTipListner,
false);
- }
-
- } else{
- if(this.hideEvent != null){
- Event.stopObserving(this.parent, this.hideEvent, this.doHideListner, false);
- }else{
- Event.stopObserving(this.parent, "blur", this.doHideListner, false);
- }
- }
- }
+ this.doDisable();
this.hintParentElement = null;
this.parent = null;
@@ -151,7 +126,6 @@
attachOnLoadEvents: function(){
if(!this.parentAttached){
- this.parent = $(this.parentId);
if(this.parent != null && !this.disabled){
this.attachParentEvents();
this.parentAttached = true;
@@ -247,6 +221,9 @@
},
doShow: function(e){
+ if (this.disabled) {
+ return;
+ }
if (this.activationTimerHandle) return;
this.setScrollDelta();
@@ -389,9 +366,41 @@
},
doEnable: function(){
+ if(!this.parentAttached) {
+ Event.observe(document, "mousemove", this.attachOnLoadEventsListner, true);
+ }
this.disabled = false;
},
- doDisable: function(){
+ doDisable: function() {
+ if (!this.parentAttached) {
+ if (!this.disabled) {
+ Event.stopObserving(document, "mousemove", this.attachOnLoadEventsListner,
true);
+ }
+ } else {
+ if (this.followMouse) {
+ Event.stopObserving(this.parent, 'mousemove',
this.setToolTipPositionListner, false);
+ }
+
+ Event.stopObserving(this.parent, this.event, this.doShowListner, false);
+
+ if (this.showEvent != "focus") {
+ if(this.hideEvent != null) {
+ Event.stopObserving(this.parent, this.hideEvent, this.doHideListner, false);
+ Event.stopObserving(this.toolTip, this.hideEvent, this.leaveToolTipListner,
false);
+ } else {
+ Event.stopObserving(this.parent, "mouseout", this.doHideListner, false);
+ Event.stopObserving(this.toolTip,"mouseout", this.leaveToolTipListner,
false);
+ }
+ } else {
+ if(this.hideEvent != null) {
+ Event.stopObserving(this.parent, this.hideEvent, this.doHideListner, false);
+ } else {
+ Event.stopObserving(this.parent, "blur", this.doHideListner, false);
+ }
+ }
+
+ this.parentAttached = false;
+ }
this.disabled = true;
},
Modified: trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
===================================================================
--- trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2008-03-17 16:43:30
UTC (rev 6876)
+++ trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2008-03-17 17:13:51
UTC (rev 6877)
@@ -22,8 +22,11 @@
</h:scripts-->
<f:clientid var="clientId"/>
- <span id="#{clientId}" style="position: absolute; display :
none;z-index:#{component.attributes['zorder']};
#{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip
#{component.attributes['styleClass']}">
- <f:call name="utils.encodePassThru" />
+ <span id="#{clientId}"
style="z-index:#{component.attributes['zorder']};
#{component.attributes['style']}"
+ class="dr-rich-tool-tip rich-tool-tip
#{component.attributes['styleClass']}">
+ <f:call name="utils.encodePassThruWithExclusions">
+ <f:parameter value="id,style,class,disabled" />
+ </f:call>
<jsp:scriptlet>
<![CDATA[if("ajax".equals(component.getMode()) &&
component.getFacet("defaultContent")!=null) {]]>
</jsp:scriptlet>