diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index 0e359478..6d1b5b83 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 : {}, + right : {} + + }; var key_event=function(event){ var lCurrentFile; var lName, lTop; @@ -31,14 +36,20 @@ 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; + if (lTabPanel[lId]) + lTabPanel[lId].className = lCurrentFile; + else + getById(lId).getElementsByTagName('li')[2] + .className = lCURRENT_FILE; - getById(lId).getElementsByTagName('li')[2] - .className = lCURRENT_FILE; + lId === 'right' && + (lId = 'left') || + (lId = 'right'); + lCurrentFile.className = ''; + }catch(error){console.log(error);} } /* if f3 pressed */