Skip to content

Commit

Permalink
IDEX-4164: don't remove popup element form the parent if it's null
Browse files Browse the repository at this point in the history
  • Loading branch information
Valeriy Svydenko committed Jan 28, 2016
1 parent b0ec8b8 commit 07866ee
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public abstract class PopupWidget<T> {
private static final int MIN_WIDTH = 400;
private static final int MIN_HEIGHT = 130;

/** The main element for the popup. */
private final Element popupElement;
protected final Element popupBodyElement;

/** The list (ul) element for the popup. */
Expand All @@ -53,6 +51,8 @@ public abstract class PopupWidget<T> {
* The previously focused element.
*/
private Element previousFocus;
/** The main element for the popup. */
private Element popupElement;

public PopupWidget(final PopupResources popupResources, String title) {
this.popupResources = popupResources;
Expand Down Expand Up @@ -197,8 +197,11 @@ public void hide() {
new Timer() {
@Override
public void run() {
// detach assist popup
popupElement.getParentNode().removeChild(popupElement);
if (popupElement != null) {
// detach assist popup
popupElement.getParentNode().removeChild(popupElement);
popupElement = null;
}
// remove all items from popup element
listElement.setInnerHTML("");
}
Expand Down

0 comments on commit 07866ee

Please sign in to comment.