refactor(key) mv goToParentDir to client

This commit is contained in:
coderaiser 2014-01-22 09:05:27 -05:00
parent 65d3b61668
commit f562657d58
2 changed files with 15 additions and 10 deletions

View file

@ -494,5 +494,19 @@ var Util, DOM, CloudFunc;
return ret;
}
this.goToParentDir = function() {
var Info = DOM.CurrentInfo,
path = Info.dirPath,
parentPath = Info.parentDirPath;
if (path !== parentPath) {
path = parentPath;
path = CloudFunc.FS + CloudFunc.rmLastSlash(path);
Util.exec(CloudCmd.loadDir(path));
}
};
}
})(this, Util, DOM, CloudFunc);

View file

@ -166,7 +166,6 @@ var CloudCmd, Util, DOM;
panel = Info.panel,
path = Info.path,
dirPath = Info.dirPath,
parentDirPath = Info.parentDirPath,
filesPassive = Info.filesPassive,
prev = current.previousSibling,
next = current.nextSibling,
@ -389,15 +388,7 @@ var CloudCmd, Util, DOM;
break;
case Key.BACKSPACE:
path = Info.dirPath;
if (path !== parentDirPath) {
path = parentDirPath;
path = CloudFunc.FS + CloudFunc.rmLastSlash(path);
Util.exec(CloudCmd.loadDir(path));
}
CloudCmd.goToParentDir();
DOM.preventDefault(pEvent);
break;