From 74447c0995b13f886322f7ea4c024de0d0da0c47 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Tue, 9 Jul 2013 09:52:18 -0300 Subject: [PATCH] Close the "Keyboard Shortcuts" popup on press Close the "Keyboard Shortcuts" popup on Escape press instead of release. The previous commit (052cbef) did this on press, but for consistency with other popup key actions it should be done on press. Bug: Issue 1996 Change-Id: I50031016ee5017c1a9eff5ace0e59cc527d1d418 --- .../google/gwtexpui/globalkey/client/KeyHelpPopup.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/globalkey/client/KeyHelpPopup.java b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/globalkey/client/KeyHelpPopup.java index 6f8bf80393..49c1b01f6c 100644 --- a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/globalkey/client/KeyHelpPopup.java +++ b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/globalkey/client/KeyHelpPopup.java @@ -19,8 +19,8 @@ import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyPressEvent; import com.google.gwt.event.dom.client.KeyPressHandler; -import com.google.gwt.event.dom.client.KeyUpEvent; -import com.google.gwt.event.dom.client.KeyUpHandler; +import com.google.gwt.event.dom.client.KeyDownEvent; +import com.google.gwt.event.dom.client.KeyDownHandler; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.Anchor; import com.google.gwt.user.client.ui.FlowPanel; @@ -41,7 +41,7 @@ import java.util.List; public class KeyHelpPopup extends PluginSafePopupPanel implements - KeyPressHandler, KeyUpHandler { + KeyPressHandler, KeyDownHandler { private final FocusPanel focus; public KeyHelpPopup() { @@ -80,7 +80,7 @@ public class KeyHelpPopup extends PluginSafePopupPanel implements DOM.setStyleAttribute(focus.getElement(), "outline", "0px"); DOM.setElementAttribute(focus.getElement(), "hideFocus", "true"); focus.addKeyPressHandler(this); - focus.addKeyUpHandler(this); + focus.addKeyDownHandler(this); add(focus); } @@ -105,7 +105,7 @@ public class KeyHelpPopup extends PluginSafePopupPanel implements } @Override - public void onKeyUp(final KeyUpEvent event) { + public void onKeyDown(final KeyDownEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) { hide(); }