mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
fixed bug with setting current file after refresh and refreshing dir content
This commit is contained in:
parent
c171912f17
commit
307c22173e
3 changed files with 7 additions and 5 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -248,9 +248,8 @@ var CloudCommander, Util, DOM;
|
|||
*/
|
||||
|
||||
Util.exec( DOM.getListener(lRefreshIcon) );
|
||||
CloudCmd._currentToParent(lSelectedName);
|
||||
|
||||
DOM.preventDefault();
|
||||
DOM.preventDefault(pEvent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue