]> git.wh0rd.org - tt-rss.git/commitdiff
check if moveToPost is defined before parsing n/p hotkeys
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 13 Aug 2006 04:12:33 +0000 (05:12 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 13 Aug 2006 04:12:33 +0000 (05:12 +0100)
functions.js

index ec129aeb16ab7cacbf72b2dd938a728cb553ce59..aec6a82c0342fce2f517c6cd8693c2599837c6a8 100644 (file)
@@ -203,11 +203,15 @@ function hotkey_handler(e) {
                }
 
                if (keycode == 78 || keycode == 40) { // n, down
-                       return h_ctx.moveToPost('next');
+                       if (typeof h_ctx.moveToPost != undefined) {
+                               return h_ctx.moveToPost('next');
+                       }
                }
        
                if (keycode == 80 || keycode == 38) { // p, up
-                       return h_ctx.moveToPost('prev');
+                       if (typeof h_ctx.moveToPost != undefined) {
+                               return h_ctx.moveToPost('prev');
+                       }
                }
                
                if (typeof localHotkeyHandler != 'undefined') {