fixed bug with setting current file after refresh and refreshing dir content

This commit is contained in:
coderaiser 2013-02-19 04:03:52 -05:00
parent c171912f17
commit 307c22173e
3 changed files with 7 additions and 5 deletions

View file

@ -138,6 +138,9 @@ directory.
* Removed reflows maded by js.
* Fixed bug with setting current file
after refresh and refreshing dir content.
2012.12.12, Version 0.1.8

View file

@ -85,7 +85,7 @@ CloudCmd._loadDir = function(pLink, pNeedRefresh){
lLink = pLink || Util.removeStr(lHref, CloudCmd.HOST),
lDir = DOM.getCurrentDir();
if(pLink || lCurrentLink.target !== '_blank'){
if(lLink || lCurrentLink.target !== '_blank'){
DOM.Images.showLoad(pNeedRefresh ? {top:true} : null);
/* загружаем содержимое каталога */
@ -536,7 +536,7 @@ CloudCmd._ajaxLoad = function(pPath, pOptions){
var lFSPath = decodeURI(pPath);
lFSPath = Util.removeStr( lFSPath, CloudFunc.NOJS );
var lCleanPath = Util.removeStr(lFSPath, CloudFunc.FS);
var lCleanPath = Util.removeStr(lFSPath, CloudFunc.FS) || '/';
Util.log ('reading dir: "' + lCleanPath + '";');
@ -601,6 +601,7 @@ CloudCmd._createFileTable = function(pElem, pJSON, pSetCurrent){
var lElem = DOM.getById(pElem),
/* getting current element if was refresh */
lPath = DOM.getByClass('path', lElem),
lCurrent = DOM.getCurrentFile(),
lWasRefresh_b = lPath[0].textContent === pJSON[0].path;
/* говорим построителю,
@ -618,7 +619,6 @@ CloudCmd._createFileTable = function(pElem, pJSON, pSetCurrent){
/* searching current file */
if(lWasRefresh_b){
var lCurrent = DOM.getCurrentFile();
for(i = 0; i < lElem.childNodes.length; i++)
if(lElem.childNodes[i].textContent === lCurrent.textContent){
lCurrent = lElem.childNodes[i];

View file

@ -248,9 +248,8 @@ var CloudCommander, Util, DOM;
*/
Util.exec( DOM.getListener(lRefreshIcon) );
CloudCmd._currentToParent(lSelectedName);
DOM.preventDefault();
DOM.preventDefault(pEvent);
}
}