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";