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 */