mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
removed pEvent from loadDir
This commit is contained in:
parent
e83d9ed711
commit
222baeffbc
4 changed files with 46 additions and 31 deletions
|
|
@ -4,6 +4,8 @@
|
|||
<meta charset="utf-8">
|
||||
<!-- mobile first design -->
|
||||
<meta content="width=device-width,initial-scale=1" name="viewport" />
|
||||
<!-- chrome frame -->
|
||||
<meta http-equiv="X-UA-Compatible" content=" chrome=1" />
|
||||
<title>{title}</title>
|
||||
|
||||
<link rel=stylesheet href="/css/reset.css">
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ CloudCmd.GoogleAnalytics = function(){
|
|||
* @param pLink - ссылка
|
||||
* @param pNeedRefresh - необходимость обязательной загрузки данных с сервера
|
||||
*/
|
||||
CloudCmd._loadDir = function(pLink, pNeedRefresh){
|
||||
return function(pEvent){
|
||||
CloudCmd.loadDir = function(pLink, pNeedRefresh){
|
||||
return function(){
|
||||
/* показываем гиф загрузки возле пути папки сверху
|
||||
* ctrl+r нажата? */
|
||||
|
||||
|
|
@ -97,8 +97,6 @@ CloudCmd._loadDir = function(pLink, pNeedRefresh){
|
|||
if(lParent === '..' && lDir !== '/')
|
||||
CloudCmd._currentToParent(lDir);
|
||||
}
|
||||
|
||||
DOM.preventDefault(pEvent);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -484,15 +482,15 @@ CloudCmd._changeLinks = function(pPanelID){
|
|||
},
|
||||
|
||||
lUrl = CloudCmd.HOST,
|
||||
lLoadDirOnce = CloudCmd._loadDir();
|
||||
|
||||
lLoadDirOnce = CloudCmd.loadDir();
|
||||
|
||||
(function(a){
|
||||
var a0 = a[0],
|
||||
lParent = a0.parentElement,
|
||||
lNEEDREFRESH = true,
|
||||
lLink = Util.removeStr(a0.href, lUrl);
|
||||
|
||||
CloudCmd.refresh = CloudCmd._loadDir(lLink, lNEEDREFRESH);
|
||||
CloudCmd.refresh = CloudCmd.loadDir(lLink, lNEEDREFRESH);
|
||||
|
||||
/* ставим загрузку гифа на клик*/
|
||||
DOM.addClickListener( CloudCmd.refresh, lParent );
|
||||
|
|
@ -503,7 +501,7 @@ CloudCmd._changeLinks = function(pPanelID){
|
|||
/* убираем адрес хоста*/
|
||||
var ai = a[i],
|
||||
lLink = Util.removeStr(ai.href, lUrl),
|
||||
lLoadDir = CloudCmd._loadDir(lLink),
|
||||
lLoadDir = CloudCmd.loadDir(lLink),
|
||||
/* устанавливаем обработчики на строку
|
||||
* на двойное нажатие на левую кнопку мышки */
|
||||
lLi = ai.parentElement.parentElement;
|
||||
|
|
|
|||
|
|
@ -434,13 +434,27 @@ var CloudCommander, Util,
|
|||
/* dom element passed and it is not event */
|
||||
if( Util.isObject(pCurrentFile) && !pCurrentFile.type)
|
||||
lCurrent = pCurrentFile;
|
||||
else
|
||||
lCurrent = DOM.getCurrentFile();
|
||||
|
||||
lName = DOM.getCurrentName(lCurrent);
|
||||
|
||||
lRet = confirm(lMsg + lName + '?');
|
||||
|
||||
if(lRet)
|
||||
DOM.deleteCurrent(lCurrent);
|
||||
if(lRet){
|
||||
var lParent = lCurrent.parentElement,
|
||||
lUrl = DOM.getCurrentPath(lCurrent);
|
||||
|
||||
if( DOM.isCurrentIsDir(lCurrent) )
|
||||
lUrl += '?dir';
|
||||
|
||||
if(lCurrent && lParent && lName !== '..')
|
||||
DOM.RESTfull.delete(lUrl, function(){
|
||||
DOM.deleteCurrent(lCurrent);
|
||||
});
|
||||
|
||||
return lCurrent;
|
||||
}
|
||||
|
||||
return lRet;
|
||||
};
|
||||
|
|
@ -1374,24 +1388,19 @@ var CloudCommander, Util,
|
|||
DOM.deleteCurrent = function(pCurrent){
|
||||
var lCurrent = pCurrent || DOM.getCurrentFile(),
|
||||
lParent = lCurrent.parentElement,
|
||||
lName = DOM.getCurrentName(lCurrent),
|
||||
lUrl = DOM.getCurrentPath(lCurrent);
|
||||
lName = DOM.getCurrentName(lCurrent);
|
||||
|
||||
if( DOM.isCurrentIsDir(lCurrent) )
|
||||
lUrl += '?dir';
|
||||
|
||||
if(lCurrent && lParent && lName !== '..')
|
||||
DOM.RESTfull.delete(lUrl, function(){
|
||||
var lNext = lCurrent.nextSibling,
|
||||
lPrevious = lCurrent.previousSibling;
|
||||
|
||||
if(lNext)
|
||||
DOM.setCurrentFile(lNext);
|
||||
else if(lPrevious)
|
||||
DOM.setCurrentFile(lPrevious);
|
||||
|
||||
lParent.removeChild(lCurrent);
|
||||
});
|
||||
if(lCurrent && lParent && lName !== '..'){
|
||||
var lNext = lCurrent.nextSibling,
|
||||
lPrevious = lCurrent.previousSibling;
|
||||
|
||||
if(lNext)
|
||||
DOM.setCurrentFile(lNext);
|
||||
else if(lPrevious)
|
||||
DOM.setCurrentFile(lPrevious);
|
||||
|
||||
lParent.removeChild(lCurrent);
|
||||
}
|
||||
|
||||
return lCurrent;
|
||||
};
|
||||
|
|
@ -1444,7 +1453,8 @@ var CloudCommander, Util,
|
|||
};
|
||||
|
||||
DOM.RESTfull.mv(lFiles, function(){
|
||||
CloudCommander.refresh();
|
||||
//CloudCommander.refresh();
|
||||
DOM.deleteCurrent(lCurrent);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -117,8 +117,13 @@ var CloudCommander, Util, DOM;
|
|||
DOM.preventDefault(pEvent);//запрет на дальнейшее действие
|
||||
}
|
||||
else if(lKeyCode === KEY.Delete){
|
||||
if(pEvent.shiftKey)
|
||||
DOM.deleteCurrent(lCurrentFile);
|
||||
if(pEvent.shiftKey){
|
||||
var lUrl = DOM.getCurrentPath(lCurrentFile);
|
||||
|
||||
DOM.RESTfull.delete(lUrl, function(){
|
||||
DOM.deleteCurrent(lCurrentFile);
|
||||
});
|
||||
}
|
||||
else
|
||||
DOM.promptDeleteCurrent(lCurrentFile);
|
||||
}
|
||||
|
|
@ -238,7 +243,7 @@ var CloudCommander, Util, DOM;
|
|||
|
||||
/* если нажали Enter - открываем папку*/
|
||||
else if(lKeyCode === KEY.ENTER && DOM.isCurrentIsDir())
|
||||
Util.exec(CloudCmd._loadDir());
|
||||
Util.exec( CloudCmd.loadDir() );
|
||||
|
||||
/* если нажали <ctr>+r
|
||||
* обновляем страницу,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue