]> source.dussan.org Git - vaadin-framework.git/commitdiff
enhancements to LoginForm
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 23 May 2008 07:20:49 +0000 (07:20 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 23 May 2008 07:20:49 +0000 (07:20 +0000)
svn changeset:4619/svn branch:trunk

src/com/itmill/toolkit/ui/LoginForm.java

index 9397aa4e5fe75f819df15aa05f946c91835bfb98..e0f30774e480d254ae6ac47dc4be4d40bc42ca44 100644 (file)
@@ -122,8 +122,11 @@ public class LoginForm extends CustomComponent {
         return (""
                 + "<html>"
                 + "<head><script type='text/javascript'>"
-                + "var setTarget = function() {document.forms[0]"
-                + ".action = top.location;document.forms[0].username.focus();};"
+                + "var setTarget = function() {"
+                + "var uri = top.location.href;"
+                + "uri = uri.replace(/\\\\?.*/, '');"
+                + "uri += /loginHandler;"
+                + ".action = uri;document.forms[0].username.focus();};"
                 + "</script>"
                 + "<link rel='stylesheet' href='"
                 + guessedThemeUri
@@ -154,6 +157,9 @@ public class LoginForm extends CustomComponent {
         // response is handled. (May happen if login handler removes login
         // form
         window = getWindow();
+        if (window.getParent() != null) {
+            window = (Window) window.getParent();
+        }
         super.detach();
     }