Vinzenz Feenstra has uploaded a new change for review.

Change subject: frontend: Fix for showTooltip condition in 
AbstractCellWithTooltip
......................................................................

frontend: Fix for showTooltip condition in AbstractCellWithTooltip

Showing tooltips with the content only works (on Firefox and Chrome
at least) if the content overflows AND contains whitespaces.
If it does not contain whitespaces it will not work. The additional
condition added by this patch will fix this issue by comparing the
actual size of the column with the scrollSize (height and width)

If either of them differs, in the sense that the clientSize is smaller
then the condition is true which means it does indeed overflow.

Change-Id: I26f4942c4f24beedd6b22261f8928bc4b1af5e50
Bug-Url: https://bugzilla.redhat.com/996496
Signed-off-by: Vinzenz Feenstra <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCellWithTooltip.java
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/04/18004/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCellWithTooltip.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCellWithTooltip.java
index cbf4b0c..5918c75 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCellWithTooltip.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCellWithTooltip.java
@@ -64,9 +64,10 @@
         parent.getStyle().setProperty("overflow", "auto"); //$NON-NLS-1$ 
//$NON-NLS-2$
 
         int scrollWidthAfter = parent.getScrollWidth();
+        int clientWidthAfter = parent.getClientWidth();
         parent.getStyle().setProperty("overflow", overflowValue); //$NON-NLS-1$
 
-        return scrollWidthAfter > scrollWidthBefore;
+        return scrollWidthAfter > scrollWidthBefore || scrollWidthAfter > 
clientWidthAfter;
     }
 
     /**
@@ -79,11 +80,11 @@
         int clientHeightBefore = parent.getClientHeight();
         String whiteSpaceValue = parent.getStyle().getProperty("whiteSpace"); 
//$NON-NLS-1$
         parent.getStyle().setProperty("whiteSpace", "normal"); //$NON-NLS-1$ 
//$NON-NLS-2$
-
+        int scrollHeightAfter = parent.getScrollHeight();
         int clientHeightAfter = parent.getClientHeight();
         parent.getStyle().setProperty("whiteSpace", whiteSpaceValue); 
//$NON-NLS-1$
 
-        return clientHeightAfter > clientHeightBefore;
+        return clientHeightAfter > clientHeightBefore || clientHeightAfter < 
scrollHeightAfter;
     }
 
 }


-- 
To view, visit http://gerrit.ovirt.org/18004
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26f4942c4f24beedd6b22261f8928bc4b1af5e50
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to