From 9d49c820bd962328684af6f107e2029ded8cdc88 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 29 Apr 2015 04:31:03 -0400
Subject: [PATCH] Fix so pagejump selection list can be displayed again with click after it has been closed by Esc key
---
program/js/app.js | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/program/js/app.js b/program/js/app.js
index f1ff775..dc5c8c1 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3287,27 +3287,24 @@
$(this).keydown();
})
// keyboard navigation
- .on('keydown keyup', function(e) {
+ .on('keydown keyup click', function(e) {
var current, selector = $('#pagejump-selector'),
ul = $('ul', selector),
list = $('li', ul),
height = ul.height(),
p = parseInt(this.value);
+ if (e.which != 27 && e.which != 9 && e.which != 13 && !selector.is(':visible'))
+ return ref.show_menu('pagejump-selector', true, e);
+
if (e.type == 'keydown') {
// arrow-down
if (e.which == 40) {
- if (!selector.is(':visible'))
- return ref.show_menu('pagejump-selector', true, e);
-
if (list.length > p)
this.value = (p += 1);
}
// arrow-up
else if (e.which == 38) {
- if (!selector.is(':visible'))
- return ref.show_menu('pagejump-selector', true, e);
-
if (p > 1 && list.length > p - 1)
this.value = (p -= 1);
}
--
Gitblit v1.9.1