From 49c9e5e4de62c2c00bb606a852c5a90c277b0745 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Jul 2012 03:46:24 -0400 Subject: [PATCH] minor changes --- lib/client/keyBinding.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index 1ff103b1..894d25e9 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -11,6 +11,11 @@ CloudCommander.keyBinding=(function(){ return document.getElementById(pId); }; + var lTabPanel = { + left : 0, + right : 0 + + }; var key_event=function(event){ var lCurrentFile; var lName, lTop; @@ -31,14 +36,21 @@ CloudCommander.keyBinding=(function(){ /* changing parent panel of curent-file */ var lId = lCurrentFile.parentElement.id; - if(lId === 'right')lId = 'left'; - else lId = 'right'; - lCurrentFile.className = ''; + lTabPanel[lId] = lCurrentFile; + + lId = (lId === 'right')? + 'left':'right'; - getById(lId).getByTagName('li')[2] - .className = lCURRENT_FILE; + if(lTabPanel[lId]) + lTabPanel[lId].className = lCurrentFile; + else + getById(lId).getElementsByTagName('li')[2] + .className = lCURRENT_FILE; + + lCurrentFile.className = ''; + }catch(error){console.log(error);} } /* if f3 pressed */