mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 19:57:36 +08:00
Style "empty-caption" for button without caption #PL-5218
This commit is contained in:
parent
aebeffc7c9
commit
48dfead0f1
@ -18,6 +18,10 @@ import com.vaadin.client.ui.VButton;
|
||||
*/
|
||||
public class CubaButtonWidget extends VButton {
|
||||
|
||||
public CubaButtonWidget() {
|
||||
addStyleDependentName("empty-caption");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() >= 11) {
|
||||
@ -28,6 +32,17 @@ public class CubaButtonWidget extends VButton {
|
||||
super.onClick(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(String text) {
|
||||
if (text == null || "".equals(text)) {
|
||||
addStyleDependentName("empty-caption");
|
||||
} else {
|
||||
removeStyleDependentName("empty-caption");
|
||||
}
|
||||
|
||||
super.setText(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean handleKeyboardEvents(Event event) {
|
||||
int type = DOM.eventGetType(event);
|
||||
|
Loading…
Reference in New Issue
Block a user