From 288eb205d487175ec4960701fdd9b5936a6320f9 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 17 Jul 2012 15:02:35 -0400 Subject: [PATCH] added getPanel function, left is not the only panel, thet could be using for text editing --- lib/client/editor.js | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index 522c1a2e..0272b364 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -77,20 +77,29 @@ CloudCommander.Editor.CloudMirror = { lCloudEditor && (lCloudEditor.className = ''); }), - hide :(function(pParent) { - return function(){ - CloudCommander.keyBinded = true; - - var lLeft = pParent.getById('left'); - var lCloudEditor = pParent.getById('CloudEditor'); - - lCloudEditor && - (lCloudEditor.className = 'hidden'); - - lLeft && - (lLeft.className = 'panel'); - }}), - getById: function(pId){return document.getElementById(pId);} + hide : (function(pParent) { + return function(){ + CloudCommander.keyBinded = true; + + var lLeft = pParent.getById('left'); + var lCloudEditor = pParent.getById('CloudEditor'); + + lCloudEditor && + (lCloudEditor.className = 'hidden'); + + lLeft && + (lLeft.className = 'panel'); + }; + }), + getById: function(pId){return document.getElementById(pId);}, + + getPanel: function(){ + var lCurrent = document.getElementsByClassName('current-file'); + lCurrent.length && + (lCurrent = lCurrent[0].parentElement); + + return lCurrent && lCurrent.id; + } }; CloudCommander.Editor.Keys = (function(){ "use strict";