aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/static/js
diff options
context:
space:
mode:
authorJakob Kramer <jakob.kramer@gmx.de>2012-03-24 14:49:43 +0100
committerJakob Kramer <jakob.kramer@gmx.de>2012-03-24 14:49:43 +0100
commite8be1d7af550267ab8e5e4cd3aad7a2e28e65ce3 (patch)
tree4d8dffbfb9324d7f66c1740594df294d0d4d4084 /mediagoblin/static/js
parent32d8cf45114634d7d862db8b6255e07a1b94ffde (diff)
downloadmediagoblin-e8be1d7af550267ab8e5e4cd3aad7a2e28e65ce3.tar.lz
mediagoblin-e8be1d7af550267ab8e5e4cd3aad7a2e28e65ce3.tar.xz
mediagoblin-e8be1d7af550267ab8e5e4cd3aad7a2e28e65ce3.zip
Allow arrow keys in input fields and textareas
If you pressed an arrow key in a textarea before, the next/previous media was opened.
Diffstat (limited to 'mediagoblin/static/js')
-rw-r--r--mediagoblin/static/js/keyboard_navigation.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/mediagoblin/static/js/keyboard_navigation.js b/mediagoblin/static/js/keyboard_navigation.js
index d4039a3c..7401e4d8 100644
--- a/mediagoblin/static/js/keyboard_navigation.js
+++ b/mediagoblin/static/js/keyboard_navigation.js
@@ -16,6 +16,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* It must be wrapped into a function and you also cannot use
+ * $(':not(textarea, input)') because of some reason. */
+
+$(document).ready(function(){
+ $('textarea, input').keydown(function(event){
+ event.stopPropagation();
+ });
+});
+
$(document).keydown(function(event){
switch(event.which){
case 37:
@@ -30,4 +39,3 @@ $(document).keydown(function(event){
break;
}
});
-