From: Matti Tahvonen Date: Thu, 8 Jan 2009 08:17:28 +0000 (+0000) Subject: fixes #2427, disabling link component X-Git-Tag: 6.7.0.beta1~3398 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=861c091d975593a63749d502a7fdcdf63c4f11bb;p=vaadin-framework.git fixes #2427, disabling link component svn changeset:6442/svn branch:trunk --- diff --git a/WebContent/ITMILL/themes/default/common/common.css b/WebContent/ITMILL/themes/default/common/common.css index 7d6f0d8cc0..c8266a59da 100644 --- a/WebContent/ITMILL/themes/default/common/common.css +++ b/WebContent/ITMILL/themes/default/common/common.css @@ -214,6 +214,10 @@ input.i-modified, vertical-align: middle; } +.i-disabled a { + cursor: default; +} + .i-link img { vertical-align: middle; } diff --git a/WebContent/ITMILL/themes/default/styles.css b/WebContent/ITMILL/themes/default/styles.css index cb20c81a5c..2bf27bcf4a 100644 --- a/WebContent/ITMILL/themes/default/styles.css +++ b/WebContent/ITMILL/themes/default/styles.css @@ -382,6 +382,12 @@ input.i-modified, vertical-align: middle; } +.i-disabled a { + cursor: default; +} + + + .i-link img { vertical-align: middle; } 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 4e5f5ee34c..016e7c4aed 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ILink.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ILink.java @@ -97,7 +97,6 @@ public class ILink extends HTML implements Paintable, ClickListener { // handle error if (uidl.hasAttribute("error")) { - final UIDL errorUidl = uidl.getErrors(); if (errorIndicatorElement == null) { errorIndicatorElement = DOM.createDiv(); DOM.setElementProperty(errorIndicatorElement, "className", @@ -167,10 +166,14 @@ public class ILink extends HTML implements Paintable, ClickListener { if (client != null) { client.handleTooltipEvent(event, this); } - if (DOM.compare(target, captionElement) - || (icon != null && DOM.compare(target, icon.getElement()))) { + if (target == captionElement + || (icon != null && target == icon.getElement())) { super.onBrowserEvent(event); } + if (!enabled) { + event.preventDefault(); + } + } }