mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 01:17:18 +00:00
fix(dom) setCurrentFile: add CENTER
This commit is contained in:
parent
d79129c856
commit
886a65f7be
1 changed files with 8 additions and 7 deletions
|
|
@ -1059,24 +1059,25 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
* unified way to set current file
|
||||
*/
|
||||
this.setCurrentFile = function(currentFile) {
|
||||
var lRet,
|
||||
lCurrentFileWas = this.getCurrentFile();
|
||||
var ret,
|
||||
CENTER = true,
|
||||
currentFileWas = this.getCurrentFile();
|
||||
|
||||
if (currentFile) {
|
||||
if (lCurrentFileWas)
|
||||
unsetCurrentFile(lCurrentFileWas);
|
||||
if (currentFileWas)
|
||||
unsetCurrentFile(currentFileWas);
|
||||
|
||||
this.addClass(currentFile, CURRENT_FILE);
|
||||
|
||||
/* scrolling to current file */
|
||||
this.scrollIntoViewIfNeeded(currentFile);
|
||||
this.scrollIntoViewIfNeeded(currentFile, CENTER);
|
||||
|
||||
lRet = true;
|
||||
ret = true;
|
||||
|
||||
Cmd.updateCurrentInfo();
|
||||
}
|
||||
|
||||
return lRet;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue