mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(key) switchKey PAGE_UP: rm tryCatch
This commit is contained in:
parent
cc494e486f
commit
dd3c3ac441
1 changed files with 2 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue