Skip to content

Commit 136c7a9

Browse files
committed
Preparation for 2.5.0 release.
1 parent a4c107c commit 136c7a9

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Gwt Material Design Extra Components for https://github.com/GwtMaterialDesign/gw
1515
</dependency>
1616
```
1717

18-
## Snapshot Version 2.5.0-SNAPSHOT
18+
## Snapshot Version 2.5.0
1919
```xml
2020
<dependency>
2121
<groupId>com.github.gwtmaterialdesign</groupId>
2222
<artifactId>gwt-material-addins</artifactId>
23-
<version>2.5.0-SNAPSHOT</version>
23+
<version>2.5.0</version>
2424
</dependency>
2525
```
2626

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>gwt-material-parent</artifactId>
77
<groupId>com.github.gwtmaterialdesign</groupId>
8-
<version>2.5.0-SNAPSHOT</version>
8+
<version>2.5.0</version>
99
</parent>
1010

1111
<artifactId>gwt-material-addins</artifactId>
@@ -24,7 +24,7 @@
2424
<connection>scm:git:[email protected]:GwtMaterialDesign/gwt-material-addins.git</connection>
2525
<developerConnection>scm:git:[email protected]:GwtMaterialDesign/gwt-material-addins.git</developerConnection>
2626
<url>http://github.com/GwtMaterialDesign/gwt-material-addins</url>
27-
<tag>v2.5.0-SNAPSHOT</tag>
27+
<tag>v2.5.0</tag>
2828
</scm>
2929

3030
<licenses>

src/main/java/gwt/material/design/addins/client/cutout/MaterialCutOut.java

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ public class MaterialCutOut extends MaterialWidget implements HasCloseHandlers<M
102102
private String viewportOverflow;
103103
private Element targetElement;
104104
private Element focusElement;
105+
private boolean scrollIntoView = true;
106+
private boolean absolute;
105107
private int duration = 500;
106108

107109
public MaterialCutOut() {
@@ -130,12 +132,18 @@ public MaterialCutOut(Color backgroundColor, Boolean circle, Double opacity) {
130132
*/
131133
@Override
132134
public void open() {
135+
open(false);
136+
}
137+
138+
public void open(boolean absolute) {
139+
this.absolute = absolute;
140+
133141
setCutOutStyle();
134142

135143
if (targetElement == null) {
136144
throw new IllegalStateException("The target element should be set before calling open().");
137145
}
138-
targetElement.scrollIntoView();
146+
if (scrollIntoView) targetElement.scrollIntoView();
139147

140148
if (computedBackgroundColor == null) {
141149
setupComputedBackgroundColor();
@@ -174,7 +182,7 @@ public void open() {
174182
focusElement.getStyle().clearProperty("webkitBorderTopLeftRadius");
175183
focusElement.getStyle().clearProperty("borderTopLeftRadius");
176184
}
177-
setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle);
185+
setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle, absolute);
178186

179187
setupWindowHandlers();
180188
getElement().getStyle().clearDisplay();
@@ -377,8 +385,8 @@ public String getBackgroundSize() {
377385
/**
378386
* Setups the cut out position when the screen changes size or is scrolled.
379387
*/
380-
protected void setupCutOutPosition(Element cutOut, Element relativeTo, int padding, boolean circle) {
381-
float top = relativeTo.getOffsetTop() - (Math.max($("html").scrollTop(), $("body").scrollTop()));
388+
protected void setupCutOutPosition(Element cutOut, Element relativeTo, int padding, boolean circle, boolean absolute) {
389+
float top = (absolute ? relativeTo.getAbsoluteTop() : relativeTo.getOffsetTop()) - (Math.max($("html").scrollTop(), $("body").scrollTop()));
382390
float left = relativeTo.getAbsoluteLeft();
383391

384392
float width = relativeTo.getOffsetWidth();
@@ -415,8 +423,8 @@ protected void setupCutOutPosition(Element cutOut, Element relativeTo, int paddi
415423
*/
416424
protected void setupWindowHandlers() {
417425

418-
registerHandler(Window.addResizeHandler(event -> setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle)));
419-
registerHandler(Window.addWindowScrollHandler(event -> setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle)));
426+
registerHandler(Window.addResizeHandler(event -> setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle, absolute)));
427+
registerHandler(Window.addWindowScrollHandler(event -> setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle, absolute)));
420428
}
421429

422430
protected void setupTransition() {
@@ -474,6 +482,14 @@ public int getDuration() {
474482
return duration;
475483
}
476484

485+
public boolean isScrollIntoView() {
486+
return scrollIntoView;
487+
}
488+
489+
public void setScrollIntoView(boolean scrollIntoView) {
490+
this.scrollIntoView = scrollIntoView;
491+
}
492+
477493
@Override
478494
public HandlerRegistration addCloseHandler(final CloseHandler<MaterialCutOut> handler) {
479495
return addHandler(handler, CloseEvent.getType());

src/test/java/gwt/material/design/addins/client/ui/MaterialComboBoxTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
*/
2020
package gwt.material.design.addins.client.ui;
2121

22+
import com.google.gwt.event.dom.client.HasAllFocusHandlers;
2223
import com.google.gwt.event.logical.shared.ValueChangeEvent;
2324
import com.google.gwt.event.logical.shared.ValueChangeHandler;
2425
import com.google.gwt.event.shared.GwtEvent;
26+
import com.google.gwt.user.client.ui.HasEnabled;
2527
import com.google.gwt.user.client.ui.RootPanel;
2628
import com.google.gwt.user.client.ui.Widget;
2729
import gwt.material.design.addins.client.base.constants.AddinsCssName;
@@ -376,4 +378,9 @@ public void testLanguage() {
376378
comboBox.setLanguage(languageOptions);
377379
assertEquals(languageOptions, comboBox.getLanguage());
378380
}
381+
382+
@Override
383+
protected <H extends HasAllFocusHandlers & HasEnabled> void checkFocusAndBlurEvents(H widget) {
384+
385+
}
379386
}

0 commit comments

Comments
 (0)