mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
added function getCurrentLink
This commit is contained in:
parent
c77a69b4b8
commit
b872278adc
1 changed files with 25 additions and 6 deletions
31
client.js
31
client.js
|
|
@ -431,6 +431,22 @@ CloudClient.Util = (function(){
|
|||
return lCurrent;
|
||||
};
|
||||
|
||||
this.getCurrentLink = function(pCurrentFile){
|
||||
var lCurrent = this.getCurrentFile();
|
||||
|
||||
var lLink;
|
||||
lLink = (pCurrentFile ? pCurrentFile : lCurrent)
|
||||
.getElementsByTagName('a')[0];
|
||||
|
||||
if(!lLink)
|
||||
this.CloudStatus = {
|
||||
code : -1,
|
||||
msg : 'Error current element do not contain links'
|
||||
};
|
||||
|
||||
return lLink;
|
||||
};
|
||||
|
||||
/* function getting panel active, or passive
|
||||
* @pPanel_o = {active: true}
|
||||
*/
|
||||
|
|
@ -472,6 +488,8 @@ CloudClient.Util = (function(){
|
|||
if(lPanel)
|
||||
lPanel.className = 'panel hidden';
|
||||
};
|
||||
|
||||
this.CloudStatus = {};
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -576,10 +594,11 @@ CloudClient._loadDir=(function(pLink,pNeedRefresh){
|
|||
* @pEvent
|
||||
*/
|
||||
CloudClient._editFileName = (function(pParent){
|
||||
var lA = pParent.getElementsByTagName('a');
|
||||
if (lA.length && lA.textContent !== '..'){
|
||||
var lA = Util.getCurrentLink(pParent);
|
||||
|
||||
if (lA && lA.textContent !== '..'){
|
||||
|
||||
lA[0].contentEditable = true;
|
||||
lA.contentEditable = true;
|
||||
CloudCommander.keyBinded = false;
|
||||
|
||||
var lDocumentOnclick = document.onclick;
|
||||
|
|
@ -589,9 +608,9 @@ var lA = pParent.getElementsByTagName('a');
|
|||
* backs
|
||||
*/
|
||||
document.onclick = (function(){
|
||||
var lA = pParent.getElementsByTagName('a');
|
||||
if (lA.length && lA.textContent !== '..')
|
||||
lA[0].contentEditable = false;
|
||||
var lA = Util.getCurrentLink(pParent);
|
||||
if (lA && lA.textContent !== '..')
|
||||
lA.contentEditable = false;
|
||||
|
||||
CloudCommander.keyBinded = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue