JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
blur on ESC, don't propogate bound key events
[userscripts.git] / numbered_links.user.js
index 3598b68..e442ca8 100644 (file)
@@ -367,11 +367,17 @@ function init() {
                                                switch (c) {
                                                        case 'c':
                                                                window.scrollBy(0, -200);
+                                                               stop_event(e);
                                                        break;
                                                        case 't':
                                                                window.scrollBy(0, 200);
+                                                               stop_event(e);
                                                        break;
                                                }
+                                       } else if (e.keyCode == 27) {
+                                               // unfocus on ESC
+                                               document.activeElement.blur();
+                                               stop_event(e);
                                        }
                                }
                        }