mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
added condition of pth and fm_header to setCurrentFile
This commit is contained in:
parent
cbd4b20379
commit
a33de82db2
1 changed files with 44 additions and 31 deletions
75
client.js
75
client.js
|
|
@ -5,7 +5,7 @@
|
|||
* клиентский и серверный
|
||||
*/
|
||||
|
||||
var CloudCommander=(function(){
|
||||
var CloudCommander = (function(){
|
||||
"use strict";
|
||||
|
||||
/* Клиентский обьект, содержащий функциональную часть*/
|
||||
|
|
@ -493,19 +493,39 @@ CloudClient.Util = (function(){
|
|||
};
|
||||
|
||||
this.setCurrentFile = function(pCurrentFile){
|
||||
if(!pCurrentFile)
|
||||
var lRet_b = true;
|
||||
|
||||
if(!pCurrentFile){
|
||||
this.addCloudStatus({
|
||||
code : -1,
|
||||
msg : 'Error pCurrentFile in' +
|
||||
'setCurrentFile' +
|
||||
'could not be none'
|
||||
});
|
||||
|
||||
|
||||
lRet_b = false;
|
||||
}
|
||||
var lCurrentFileWas = this.getCurrentFile();
|
||||
if(lCurrentFileWas)
|
||||
this.unSetCurrentFile(lCurrentFileWas);
|
||||
|
||||
var lClass = pCurrentFile.className;
|
||||
if (lClass !== 'path' &&
|
||||
lClass !== 'fm_header'){
|
||||
pCurrentFile.className = CloudCommander.CURRENT_FILE;
|
||||
} else {
|
||||
this.addCloudStatus({
|
||||
code : -2,
|
||||
msg : 'Error pCurrentFile in' +
|
||||
'setCurrentFile' +
|
||||
'could not be ' +
|
||||
'path or fm_header';
|
||||
});
|
||||
|
||||
lRet_b = false;
|
||||
}
|
||||
|
||||
return pCurrentFile.className = CloudCommander.CURRENT_FILE;
|
||||
return lRet_b;
|
||||
};
|
||||
|
||||
this.unSetCurrentFile = function(pCurrentFile){
|
||||
|
|
@ -758,33 +778,26 @@ CloudClient._setCurrent=(function(){
|
|||
*/
|
||||
return function(pFromEnter){
|
||||
var lCurrentFile = Util.getCurrentFile();
|
||||
if(lCurrentFile){
|
||||
/* если мы находимся не на
|
||||
* пути и не на заголовках
|
||||
*/
|
||||
if(this.className!=='path' &&
|
||||
this.className!=='fm_header'){
|
||||
|
||||
if (Util.isCurrentFile(this) &&
|
||||
typeof pFromEnter !== 'boolean'){
|
||||
var lParent = this;
|
||||
|
||||
setTimeout(function(){
|
||||
/* waiting a few seconds
|
||||
* and if classes still equal
|
||||
* make file name editable
|
||||
* in other case
|
||||
* double click event happend
|
||||
*/
|
||||
if(Util.isCurrentFile(lParent))
|
||||
CloudClient._editFileName(lParent);
|
||||
},400);
|
||||
}
|
||||
else{
|
||||
/* устанавливаем курсор на файл,
|
||||
* на который нажали */
|
||||
Util.setCurrentFile(this);
|
||||
}
|
||||
if(lCurrentFile){
|
||||
if (Util.isCurrentFile(this) &&
|
||||
typeof pFromEnter !== 'boolean'){
|
||||
var lParent = this;
|
||||
|
||||
setTimeout(function(){
|
||||
/* waiting a few seconds
|
||||
* and if classes still equal
|
||||
* make file name editable
|
||||
* in other case
|
||||
* double click event happend
|
||||
*/
|
||||
if(Util.isCurrentFile(lParent))
|
||||
CloudClient._editFileName(lParent);
|
||||
},400);
|
||||
}
|
||||
else{
|
||||
/* устанавливаем курсор на файл,
|
||||
* на который нажали */
|
||||
Util.setCurrentFile(this);
|
||||
}
|
||||
}
|
||||
/* если мы попали сюда с энтера*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue