diff options
author | Tapio Aali <tapio@vaadin.com> | 2012-05-23 09:01:22 +0000 |
---|---|---|
committer | Tapio Aali <tapio@vaadin.com> | 2012-05-23 09:01:22 +0000 |
commit | edf451f67f4d50d5baeb4ae9ceaa6746eb6fa10c (patch) | |
tree | 843c57b7013bebd5130ec8c1030b83902a7e34df /src/com/vaadin/terminal/gwt | |
parent | e8a652c91e9e02079180a854789afd5accffce7b (diff) | |
download | vaadin-framework-edf451f67f4d50d5baeb4ae9ceaa6746eb6fa10c.tar.gz vaadin-framework-edf451f67f4d50d5baeb4ae9ceaa6746eb6fa10c.zip |
Fixed styles that were left lingering while changing the orientation of a slider (#7002).
svn changeset:23813/svn branch:6.8
Diffstat (limited to 'src/com/vaadin/terminal/gwt')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VSlider.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java index 4a46346613..e605c6fe12 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java @@ -200,8 +200,12 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field, private void buildBase() { final String styleAttribute = vertical ? "height" : "width"; + final String oppositeStyleAttribute = vertical ? "width" : "height"; final String domProperty = vertical ? "offsetHeight" : "offsetWidth"; + // clear unnecessary opposite style attribute + DOM.setStyleAttribute(base, oppositeStyleAttribute, ""); + final Element p = DOM.getParent(getElement()); if (DOM.getElementPropertyInt(p, domProperty) > 50) { if (vertical) { @@ -235,10 +239,15 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field, private void buildHandle() { final String styleAttribute = vertical ? "height" : "width"; final String handleAttribute = vertical ? "marginTop" : "marginLeft"; + final String oppositeHandleAttribute = vertical ? "marginLeft" + : "marginTop"; final String domProperty = vertical ? "offsetHeight" : "offsetWidth"; DOM.setStyleAttribute(handle, handleAttribute, "0"); + // clear unnecessary opposite handle attribute + DOM.setStyleAttribute(handle, oppositeHandleAttribute, ""); + if (scrollbarStyle) { // Only stretch the handle if scrollbar style is set. int s = (int) (Double.parseDouble(DOM.getElementProperty(base, @@ -356,7 +365,7 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field, } else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) { feedbackPopup.show(); } - if(Util.isTouchEvent(event)) { + if (Util.isTouchEvent(event)) { event.preventDefault(); // avoid simulated events event.stopPropagation(); } |