]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #2097 (session expired message and modal window incompatibility)
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 23 Sep 2008 05:40:37 +0000 (05:40 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 23 Sep 2008 05:40:37 +0000 (05:40 +0000)
svn changeset:5479/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java
src/com/itmill/toolkit/terminal/gwt/client/ui/INotification.java

index 9c26bdc063e0a341c19d12e8ccefa67d5dd96aae..c06e2b129c405da007bada58e600cc5063f5de9c 100755 (executable)
@@ -585,7 +585,8 @@ public class ApplicationConnection {
                 if (html.length() != 0) {
                     INotification n = new INotification(1000 * 60 * 45); //45min
                     n.addEventListener(new NotificationRedirect(url));
-                    n.show(html, INotification.CENTERED_TOP, "system");
+                    n.show(html, INotification.CENTERED_TOP,
+                            INotification.STYLE_SYSTEM);
                 } else {
                     redirect(url);
                 }
index 52ae8306c02f753f325dc0a0c7dc72e5811fc761..abb66a2bfa43168c3f8267a7d69f429f8dc8d199 100644 (file)
@@ -32,6 +32,7 @@ public class INotification extends IToolkitOverlay {
     private static final String STYLENAME = "i-Notification";\r
     private static final int mouseMoveThreshold = 7;\r
     private static final int Z_INDEX_BASE = 20000;\r
+    public static final String STYLE_SYSTEM = "system";\r
 \r
     private int startOpacity = 90;\r
     private int fadeMsec = 400;\r
@@ -223,14 +224,18 @@ public class INotification extends IToolkitOverlay {
     public boolean onEventPreview(Event event) {\r
         int type = DOM.eventGetType(event);\r
         // "modal"\r
-        if (delayMsec == -1) {\r
-            if (type == Event.ONCLICK\r
-                    && DOM\r
-                            .isOrHasChild(getElement(), DOM\r
-                                    .eventGetTarget(event))) {\r
-                fade();\r
+        if (delayMsec == -1 || temporaryStyle == STYLE_SYSTEM) {\r
+            if (type == Event.ONCLICK) {\r
+                if (DOM.isOrHasChild(getElement(), DOM.eventGetTarget(event))) {\r
+                    fade();\r
+                    return false;\r
+                }\r
+            }\r
+            if (temporaryStyle == STYLE_SYSTEM) {\r
+                return true;\r
+            } else {\r
+                return false;\r
             }\r
-            return false;\r
         }\r
         // default\r
         switch (type) {\r