From ffadcc077ed9d3e5ef1d91fa192f0e035527e4ab Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Jul 2012 10:23:33 +0300 Subject: [PATCH 1/4] Update lib/client/keyBinding.js --- lib/client/keyBinding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index 1ff103b1..0e359478 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -36,7 +36,7 @@ CloudCommander.keyBinding=(function(){ lCurrentFile.className = ''; - getById(lId).getByTagName('li')[2] + getById(lId).getElementsByTagName('li')[2] .className = lCURRENT_FILE; }catch(error){console.log(error);} From 39609b1fb6351fe72dedb85d4851a6ac13b05597 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Jul 2012 10:38:28 +0300 Subject: [PATCH 2/4] added tab positioning --- lib/client/keyBinding.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) 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 */ From f86f8fc65ceec512af71b83eba8c66cc55335bd2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Jul 2012 10:42:01 +0300 Subject: [PATCH 3/4] Update lib/client/keyBinding.js --- lib/client/keyBinding.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index 6d1b5b83..edfd0e7d 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -38,16 +38,17 @@ CloudCommander.keyBinding=(function(){ var lId = lCurrentFile.parentElement.id; lTabPanel[lId] = lCurrentFile; - if (lTabPanel[lId]) - lTabPanel[lId].className = lCurrentFile; - else - getById(lId).getElementsByTagName('li')[2] - .className = lCURRENT_FILE; - + lId === 'right' && (lId = 'left') || (lId = 'right'); + + lTabPanel[lId] && + (lTabPanel[lId].className = lCurrentFile) || + (getById(lId).getElementsByTagName('li')[2] + .className = lCURRENT_FILE); + lCurrentFile.className = ''; }catch(error){console.log(error);} From 42cd65553b9d43ae17b84e2e1effac43c458bcd8 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Jul 2012 10:45:05 +0300 Subject: [PATCH 4/4] Update lib/client/keyBinding.js --- lib/client/keyBinding.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/client/keyBinding.js b/lib/client/keyBinding.js index edfd0e7d..871b93d7 100644 --- a/lib/client/keyBinding.js +++ b/lib/client/keyBinding.js @@ -39,15 +39,15 @@ CloudCommander.keyBinding=(function(){ lTabPanel[lId] = lCurrentFile; - lId === 'right' && - (lId = 'left') || - (lId = 'right'); + lId = (lId === 'right')? + 'left':'right'; + if(lTabPanel[lId]) + lTabPanel[lId].className = lCurrentFile; - lTabPanel[lId] && - (lTabPanel[lId].className = lCurrentFile) || - (getById(lId).getElementsByTagName('li')[2] - .className = lCURRENT_FILE); + else + getById(lId).getElementsByTagName('li')[2] + .className = lCURRENT_FILE; lCurrentFile.className = '';