]> source.dussan.org Git - vaadin-framework.git/commitdiff
Window modalitycurtain will now respect $v-animations-enabled (#15135)
authorFabian Lange <lange.fabian@gmail.com>
Thu, 30 Oct 2014 10:58:26 +0000 (11:58 +0100)
committerSauli Tähkäpää <sauli@vaadin.com>
Fri, 28 Nov 2014 10:31:38 +0000 (12:31 +0200)
Change-Id: I80beea694c2a103aaf1fb479e1de48c515428fbb

WebContent/VAADIN/themes/tests-valo-disabled-animations/_variables.scss [new file with mode: 0644]
WebContent/VAADIN/themes/tests-valo-disabled-animations/styles.scss [new file with mode: 0644]
WebContent/VAADIN/themes/valo/components/_window.scss
uitest/src/com/vaadin/tests/themes/valo/ModalWindowTest.java [new file with mode: 0644]

diff --git a/WebContent/VAADIN/themes/tests-valo-disabled-animations/_variables.scss b/WebContent/VAADIN/themes/tests-valo-disabled-animations/_variables.scss
new file mode 100644 (file)
index 0000000..d2411c6
--- /dev/null
@@ -0,0 +1,3 @@
+$v-animations-enabled: false;
+
+@import "../valo/valo";
diff --git a/WebContent/VAADIN/themes/tests-valo-disabled-animations/styles.scss b/WebContent/VAADIN/themes/tests-valo-disabled-animations/styles.scss
new file mode 100644 (file)
index 0000000..b941c1b
--- /dev/null
@@ -0,0 +1,6 @@
+@import "variables";
+@import "../tests-valo/valotest";
+
+.tests-valo-disabled-animations {
+   @include valotest;
+}
index ce7a530c981f1ddfb765b43c42ac1cf3f4f4ec8d..23fa5338c2ce997da99354fa1ee9728fc62676b4 100644 (file)
@@ -89,11 +89,12 @@ $v-window-modality-curtain-background-color: #222 !default;
     left: 0;
     @include radial-gradient(circle at 50% 50%, $v-window-modality-curtain-background-color, darken($v-window-modality-curtain-background-color, valo-gradient-opacity()), $fallback: $v-window-modality-curtain-background-color);
     @include opacity(max(0.2, 0.8 - valo-gradient-opacity()/100%));
-    @include valo-animate-in-fade($duration: 400ms, $delay: 100ms);
-
-    .v-op12 & {
-      // Opera 12 has a shitbreak with the fade-in (flickers)
-      @include animation(none);
+    @if $v-animations-enabled {
+        @include valo-animate-in-fade($duration: 400ms, $delay: 100ms);
+        .v-op12 & {
+          // Opera 12 has a shitbreak with the fade-in (flickers)
+          @include animation(none);
+        }
     }
   }
 
diff --git a/uitest/src/com/vaadin/tests/themes/valo/ModalWindowTest.java b/uitest/src/com/vaadin/tests/themes/valo/ModalWindowTest.java
new file mode 100644 (file)
index 0000000..b97ce43
--- /dev/null
@@ -0,0 +1,34 @@
+package com.vaadin.tests.themes.valo;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.tests.ModalWindow;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+public class ModalWindowTest extends SingleBrowserTest {
+
+    @Override
+    protected Class<?> getUIClass() {
+        return ModalWindow.class;
+    }
+
+    @Test
+    public void modalAnimationsAreDisabled() {
+        openTestURL("theme=tests-valo-disabled-animations");
+
+        openModalWindow();
+
+        WebElement modalityCurtain = findElement(By.className("v-window-modalitycurtain"));
+
+        assertThat(modalityCurtain.getCssValue("-webkit-animation-name"), is("none"));
+    }
+
+    private void openModalWindow() {
+        $(ButtonElement.class).get(1).click();
+    }
+}
\ No newline at end of file