Skip to content

Commit b746f1f

Browse files
committed
Remove AttributeObserver & revert MaterialTooltip change.
1 parent 3b73815 commit b746f1f

File tree

3 files changed

+27
-165
lines changed

3 files changed

+27
-165
lines changed

gwt-material/src/main/java/gwt/material/design/client/base/AttributeObserver.java

Lines changed: 0 additions & 92 deletions
This file was deleted.

gwt-material/src/main/java/gwt/material/design/client/base/StyleAttributeObserver.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

gwt-material/src/main/java/gwt/material/design/client/ui/MaterialTooltip.java

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public class MaterialTooltip implements IsWidget, HasWidgets, HasOneWidget, HasI
5656
private Widget widget;
5757
private String id;
5858
private String html;
59-
private boolean initialize;
6059

6160
private HandlerRegistration attachHandler;
6261

@@ -91,42 +90,39 @@ public MaterialTooltip(final Widget w, final String text) {
9190
*/
9291
@Override
9392
public void setWidget(final Widget w) {
94-
if (!initialize) {
95-
// Validate
96-
if (w == widget) {
97-
return;
98-
}
93+
// Validate
94+
if (w == widget) {
95+
return;
96+
}
9997

100-
if (attachHandler != null) {
101-
attachHandler.removeHandler();
102-
attachHandler = null;
103-
}
98+
if (attachHandler != null) {
99+
attachHandler.removeHandler();
100+
attachHandler = null;
101+
}
104102

105-
// Detach new child
106-
if (w != null) {
107-
w.removeFromParent();
108-
}
103+
// Detach new child
104+
if (w != null) {
105+
w.removeFromParent();
106+
}
109107

110-
// Remove old child
111-
if (widget != null) {
112-
remove(widget);
113-
}
108+
// Remove old child
109+
if (widget != null) {
110+
remove(widget);
111+
}
114112

115-
// Logical attach, but don't physical attach; done by jquery.
116-
widget = w;
117-
if (widget == null) {
118-
return;
119-
}
113+
// Logical attach, but don't physical attach; done by jquery.
114+
widget = w;
115+
if (widget == null) {
116+
return;
117+
}
120118

121-
if (!widget.isAttached()) {
122-
// When we attach it, configure the tooltip
123-
attachHandler = widget.addAttachHandler(event -> {
124-
reconfigure();
125-
});
126-
} else {
119+
if (!widget.isAttached()) {
120+
// When we attach it, configure the tooltip
121+
attachHandler = widget.addAttachHandler(event -> {
127122
reconfigure();
128-
}
129-
initialize = true;
123+
});
124+
} else {
125+
reconfigure();
130126
}
131127
}
132128

0 commit comments

Comments
 (0)