fix(dom) changePanel: after copy/move on tab, panel changed to ".."

This commit is contained in:
coderaiser 2014-10-17 04:18:13 -04:00
parent d842c8db5d
commit 424dc3d82c

View file

@ -698,9 +698,9 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
/**
* get current file by name
*/
this.getCurrentByName = function(name) {
this.getCurrentByName = function(name, panelParam) {
var element,
panel = CurrentInfo.panel;
panel = panelParam || CurrentInfo.panel;
name = 'js-file-' + name;
element = DOM.getByDataName(name, panel);
@ -1686,7 +1686,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
};
this.changePanel = function() {
var id, files,
var id, files, name,
Info = CurrentInfo,
current = Info.element,
panel = Info.panel,
@ -1703,8 +1703,13 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
if (current)
files = current.parentElement;
if (!files || !files.parentElement)
current = filesPassive[0];
if (!files || !files.parentElement) {
name = DOM.getCurrentName(current);
current = DOM.getCurrentByName(name, panel);
if (!current)
current = filesPassive[0];
}
DOM.setCurrentFile(current, {
history: true