fixed bug with working links in path panel and with clicks on files

This commit is contained in:
coderaiser 2013-01-23 09:42:33 -05:00
parent a8c727a31f
commit 6b0eab1bba
4 changed files with 21 additions and 7 deletions

View file

@ -79,11 +79,9 @@ CloudCmd.GoogleAnalytics = function(){
* @param pNeedRefresh - необходимость обязательной загрузки данных с сервера
*/
CloudCmd._loadDir = function(pLink, pNeedRefresh){
return function(){
/*
* показываем гиф загрузки возле пути папки сверху
* ctrl+r нажата?
*/
return function(pEvent){
/* показываем гиф загрузки возле пути папки сверху
* ctrl+r нажата? */
DOM.Images.showLoad(pNeedRefresh ? {top:true} : null);
@ -96,6 +94,8 @@ CloudCmd._loadDir = function(pLink, pNeedRefresh){
/* если нажали на ссылку на верхний каталог*/
if(lParent === '..' && lDir !== '/')
CloudCmd._currentToParent(lDir);
pEvent.preventDefault();
};
};
@ -511,7 +511,9 @@ CloudCmd._changeLinks = function(pPanelID){
if (lLi.className === 'path')
DOM.addClickListener( lLoadDir, ai );
else {
DOM.addClickListener( Util.retFalse, lLi);
DOM.addClickListener( function(pEvent){
pEvent.preventDefault();
}, ai);
DOM.addListener('mousedown', lSetCurrentFile_f, lLi);
DOM.addListener('ondragstart', lOnDragStart_f, ai);
/* if right button clicked menu will

View file

@ -1064,6 +1064,15 @@ var CloudCommander, Util,
return lPanel;
};
/** prevent default event */
DOM.preventDefault = function(pEvent){
var lRet;
lRet = Util.exec(pEvent.preventDefault);
return lRet;
};
DOM.show = function(pElement){
DOM.removeClass(pElement, 'hidden');
};