diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-12-14 14:14:18 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-12-15 12:43:05 +0000 |
commit | 1423f6e15b3a68fd998bb22626982e214c504be5 (patch) | |
tree | f88bfc96ceefcd7f793f66b68af6125d56915bfe /client | |
parent | 4794f672d61ea0186432d73d173c92e187dbdf04 (diff) | |
download | vaadin-framework-1423f6e15b3a68fd998bb22626982e214c504be5.tar.gz vaadin-framework-1423f6e15b3a68fd998bb22626982e214c504be5.zip |
Ignore empty style names from Grid Row and CellStyleGenerators (#19364)
Change-Id: I07b241f40bcb20b92f9eea48036724dd91ecc985
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/widgets/Grid.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 2fc2b4610b..41c8f329eb 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -2851,10 +2851,13 @@ public class Grid<T> extends ResizeComposite implements @Override public void onClick(GridClickEvent event) { CellReference<?> targetCell = event.getTargetCell(); - int defaultRowIndex = getHeader().getRows().indexOf(getDefaultHeaderRow()); + int defaultRowIndex = getHeader().getRows().indexOf( + getDefaultHeaderRow()); - if(targetCell.getColumnIndex() == 0 && targetCell.getRowIndex() == defaultRowIndex) { - selectAllCheckBox.setValue(!selectAllCheckBox.getValue(), true); + if (targetCell.getColumnIndex() == 0 + && targetCell.getRowIndex() == defaultRowIndex) { + selectAllCheckBox.setValue( + !selectAllCheckBox.getValue(), true); } } }); @@ -8198,10 +8201,10 @@ public class Grid<T> extends ResizeComposite implements .getPropertyString(CUSTOM_STYLE_PROPERTY_NAME); if (!SharedUtil.equals(oldStyleName, styleName)) { - if (oldStyleName != null) { + if (oldStyleName != null && !oldStyleName.isEmpty()) { element.removeClassName(oldStyleName); } - if (styleName != null) { + if (styleName != null && !styleName.isEmpty()) { element.addClassName(styleName); } element.setPropertyString(CUSTOM_STYLE_PROPERTY_NAME, styleName); |