Skip to content

Commit

Permalink
Event notification window closes if focus is lost
Browse files Browse the repository at this point in the history
Signed-off-by: Melanie Retter <[email protected]>
  • Loading branch information
Melanie Retter authored and kaizimmerm committed Jan 9, 2017
1 parent feb3369 commit 113e528
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.springframework.beans.factory.annotation.Autowired;

import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.navigator.View;
import com.vaadin.server.FontAwesome;
import com.vaadin.spring.annotation.SpringComponent;
Expand Down Expand Up @@ -94,6 +95,11 @@ private void createNotificationWindow() {
notificationsWindow.setDraggable(false);
notificationsWindow.setId(UIComponentIdProvider.NOTIFICATION_UNREAD_POPUP_id);
notificationsWindow.addCloseListener(event -> refreshCaption());
notificationsWindow.addBlurListener(this::closeWindow);
}

private void closeWindow(final BlurEvent event) {
getUI().removeWindow((Window) event.getComponent());
}

private void toggleWindow(final ClickEvent event) {
Expand Down

0 comments on commit 113e528

Please sign in to comment.