From 9dc2c318895219338f496ffaec34afbd3254cf63 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Jul 2012 03:15:19 -0400 Subject: [PATCH] added tab support --- lib/client/keyBinding.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index 0e25dd0d..1ff103b1 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -24,9 +24,22 @@ CloudCommander.keyBinding=(function(){ */ if(event.keyCode===9){ console.log('Tab pressed'); + + var lCURRENT_FILE = CloudCommander.CURRENT_FILE; try{ - lCurrentFile=getByClass(CloudCommander.CURRENT_FILE)[0]; - }catch(error){console.log(error);} + lCurrentFile = getByClass(lCURRENT_FILE)[0]; + + /* changing parent panel of curent-file */ + var lId = lCurrentFile.parentElement.id; + if(lId === 'right')lId = 'left'; + else lId = 'right'; + + lCurrentFile.className = ''; + + getById(lId).getByTagName('li')[2] + .className = lCURRENT_FILE; + + }catch(error){console.log(error);} } /* if f3 pressed */ else if(event.keyCode===114){