From dd3c3ac44155d8bc5eec1e0f766f884e70c487de Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 29 Oct 2014 04:35:46 -0400 Subject: [PATCH] refactor(key) switchKey PAGE_UP: rm tryCatch --- lib/client/key.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/client/key.js b/lib/client/key.js index 61f45ea4..75164137 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -365,6 +365,7 @@ var CloudCmd, Util, DOM; current = current.nextSibling; } + DOM.setCurrentFile(current); Events.preventDefault(event); break; @@ -373,18 +374,8 @@ var CloudCmd, Util, DOM; case Key.PAGE_UP: DOM.scrollByPages(panel, -1); - var tryCatch = function(pCurrentFile) { - Util.exec.try(function() { - return pCurrentFile - .previousSibling - .previousSibling - .previousSibling - .previousSibling; - }); - }; - for (i = 0; i < 30; i++) { - if (!current.previousSibling || tryCatch(current) ) + if (!current.previousSibling) break; current = current.previousSibling;