From f6bd58ecc91da47ba841c54d807861b6c9bbff06 Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Mon, 3 Dec 2007 12:40:47 +0000 Subject: [PATCH] Fixed several target/features bugs svn changeset:3119/svn branch:trunk --- .../toolkit/terminal/gwt/client/ui/ILink.java | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ILink.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ILink.java index 620ff5e351..3cc0e61fb0 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ILink.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ILink.java @@ -60,11 +60,10 @@ public class ILink extends HTML implements Paintable, ClickListener { enabled = uidl.hasAttribute("disabled") ? false : true; readonly = uidl.hasAttribute("readonly") ? true : false; - if (uidl.hasAttribute("target")) { - target = uidl.getStringAttribute(target); + if (uidl.hasAttribute("name")) { + target = uidl.getStringAttribute("name"); } if (uidl.hasAttribute("src")) { - // TODO theme source src = client.translateToolkitUri(uidl.getStringAttribute("src")); } @@ -123,7 +122,7 @@ public class ILink extends HTML implements Paintable, ClickListener { public void onClick(Widget sender) { if (enabled && !readonly) { if (target == null) { - target = "_blank"; + target = "_self"; } String features; switch (borderStyle) { @@ -134,24 +133,23 @@ public class ILink extends HTML implements Paintable, ClickListener { features = "menubar=yes,location=no,status=no"; break; default: - features = "menubar=yes,location=yes,scrollbars=yes,status=yes"; + features = ""; break; } - if (width > 0 || height > 0) { - features += ",resizable=no"; - if (width > 0) { - features += ",width=" + width; - } - if (height > 0) { - features += ",height=" + height; - } - } else { - features += ",resizable=yes"; + + if (width > 0) { + features += (features.length() > 0 ? "," : "") + "width=" + + width; + } + if (height > 0) { + features += (features.length() > 0 ? "," : "") + "height=" + + height; } + Window.open(src, target, features); } } - + public void onBrowserEvent(Event event) { Element target = DOM.eventGetTarget(event); if (errorIndicatorElement != null -- 2.39.5