]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8949 Make sure a drag image always has absolute position
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Fri, 15 Jun 2012 10:38:45 +0000 (10:38 +0000)
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Fri, 15 Jun 2012 10:38:45 +0000 (10:38 +0000)
svn changeset:23944/svn branch:6.8

WebContent/VAADIN/themes/base/common/common.css
tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragStartModes.java [new file with mode: 0644]

index 8734aee63ffcbe633bcd7caaf8109050ea329510..74ed21bd1a97ddde6a294aacc95151ee427be494 100644 (file)
@@ -224,10 +224,11 @@ div.v-app-loading {
 
 .v-drag-element {
        z-index: 60000;
-       position: absolute;
-    opacity: 0.5;
-    filter: alpha(opacity=50);
-    cursor: default;
+       /* override any other position: properties */
+       position: absolute !important;
+       opacity: 0.5;
+       filter: alpha(opacity=50);
+       cursor: default;
 }
 
 .v-scrollable {
diff --git a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragStartModes.java b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragStartModes.java
new file mode 100644 (file)
index 0000000..9b2c039
--- /dev/null
@@ -0,0 +1,43 @@
+package com.vaadin.tests.components.draganddropwrapper;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.TestUtils;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.DragAndDropWrapper;
+import com.vaadin.ui.DragAndDropWrapper.DragStartMode;
+import com.vaadin.ui.Label;
+
+public class DragStartModes extends TestBase {
+
+    @Override
+    protected void setup() {
+
+        TestUtils.injectCSS(getMainWindow(),
+                ".v-ddwrapper { background: #ACF; }");
+
+        addComponent(makeWrapper(DragStartMode.NONE));
+        addComponent(makeWrapper(DragStartMode.COMPONENT));
+        addComponent(makeWrapper(DragStartMode.WRAPPER));
+        addComponent(makeWrapper(DragStartMode.HTML5));
+    }
+
+    private Component makeWrapper(DragStartMode mode) {
+        Label label = new Label("Drag start mode: " + mode);
+        DragAndDropWrapper wrapper = new DragAndDropWrapper(label);
+        wrapper.setHTML5DataFlavor("Text", "HTML5!");
+        wrapper.setDragStartMode(mode);
+        wrapper.setWidth("200px");
+        return wrapper;
+    }
+
+    @Override
+    protected String getDescription() {
+        return "Different drag start modes should show correct drag images";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 8949;
+    }
+
+}