mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
fix(client) createFileTable: when name of subdir same as parrentdir it is became current after changing directory
This commit is contained in:
parent
5d4db87a96
commit
4c9637ddc4
1 changed files with 8 additions and 26 deletions
|
|
@ -67,22 +67,6 @@ var Util, DOM, CloudFunc, join;
|
|||
}, panel, callback);
|
||||
};
|
||||
|
||||
/**
|
||||
* функция устанавливает курсор на каталог
|
||||
* с которого мы пришли, если мы поднялись
|
||||
* в верх по файловой структуре
|
||||
* @param pDirName - имя каталога с которого мы пришли
|
||||
*/
|
||||
function currentToParent(dirName) {
|
||||
var rootDir;
|
||||
/* убираем слэш с имени каталога */
|
||||
dirName = Util.rmStr(dirName, '/');
|
||||
rootDir = DOM.getCurrentByName(dirName);
|
||||
|
||||
if (rootDir)
|
||||
DOM.setCurrentFile(rootDir);
|
||||
}
|
||||
|
||||
/**
|
||||
* function load modules
|
||||
* @pParams = {name, path, func, dobefore, arg}
|
||||
|
|
@ -401,19 +385,17 @@ var Util, DOM, CloudFunc, join;
|
|||
}
|
||||
});
|
||||
|
||||
current = DOM.getCurrentByName(name);
|
||||
|
||||
if (!current) /* .. */
|
||||
current = DOM.getFiles(panel)[0];
|
||||
|
||||
DOM.setCurrentFile(current, {
|
||||
history: history
|
||||
});
|
||||
|
||||
Listeners.setOnPanel(panel.id);
|
||||
|
||||
if (name === '..' && dir !== '/')
|
||||
currentToParent(dir);
|
||||
current = DOM.getCurrentByName(dir);
|
||||
|
||||
if (!current)
|
||||
current = DOM.getFiles(panel)[0];
|
||||
|
||||
DOM.setCurrentFile(current, {
|
||||
history: history
|
||||
});
|
||||
|
||||
Util.exec(callback);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue