summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-02-19 22:05:21 +0200
committerArtur Signell <artur@vaadin.com>2013-02-19 22:05:21 +0200
commit696ef550ad583ac3c317704fcc093f87b78b64e4 (patch)
tree60581e6e3c819afec7fc55bca9eeaffb56ecf411 /client
parentf09c12fd97cbafd10b31c79a55bd90dfef02f4a9 (diff)
downloadvaadin-framework-696ef550ad583ac3c317704fcc093f87b78b64e4.tar.gz
vaadin-framework-696ef550ad583ac3c317704fcc093f87b78b64e4.zip
Ensure href is not set to "" when target is null (#10543)
A link with href="" causes a reload of the page, at least in Firefox. Change-Id: I0d04615b3669d3b7ccab5bf0d45b6a665f32fb1e
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/link/LinkConnector.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/link/LinkConnector.java b/client/src/com/vaadin/client/ui/link/LinkConnector.java
index 807a9bcc64..228897278e 100644
--- a/client/src/com/vaadin/client/ui/link/LinkConnector.java
+++ b/client/src/com/vaadin/client/ui/link/LinkConnector.java
@@ -42,7 +42,11 @@ public class LinkConnector extends AbstractComponentConnector implements
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
getWidget().src = getResourceUrl(LinkConstants.HREF_RESOURCE);
- getWidget().anchor.setAttribute("href", getWidget().src);
+ if (getWidget().src == null) {
+ getWidget().anchor.removeAttribute("href");
+ } else {
+ getWidget().anchor.setAttribute("href", getWidget().src);
+ }
}
});
}