From 948d5316d136288202b68dc636f2695489a91e90 Mon Sep 17 00:00:00 2001 From: anekos Date: Sun, 28 Mar 2010 14:20:22 +0000 Subject: switch に切り替え git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37112 d0d07461-0603-4401-acd4-de1884942a52 --- spatial-navigation.js | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'spatial-navigation.js') diff --git a/spatial-navigation.js b/spatial-navigation.js index b37ab34..fcd6991 100755 --- a/spatial-navigation.js +++ b/spatial-navigation.js @@ -109,22 +109,17 @@ let g:spatial_navigation_mappings="<A-h> <A-j> <A-k> <A-l>" window.document.commandDispatcher.focusedElement; function isRectInDirection (dir, focusedRect, anotherRect) { - if (dir === DIR.L) { - return (anotherRect.left < focusedRect.left); - } - - if (dir === DIR.R) { - return (anotherRect.right > focusedRect.right); - } - - if (dir === DIR.U) { - return (anotherRect.top < focusedRect.top); - } - - if (dir === DIR.D) { - return (anotherRect.bottom > focusedRect.bottom); + switch (dir) { + case DIR.L: + return anotherRect.left < focusedRect.left; + case DIR.R: + return anotherRect.right > focusedRect.right; + case DIR.U: + return anotherRect.top < focusedRect.top; + case DIR.D: + return anotherRect.bottom > focusedRect.bottom } - return false; + return false; } function inflateRect (rect, value) { -- cgit v1.2.3