refactored

This commit is contained in:
coderaiser 2013-03-19 10:24:58 -04:00
parent 030a4d552c
commit ef3ef781a3
3 changed files with 32 additions and 26 deletions

View file

@ -421,7 +421,7 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
/* меняем ссылки на ajax-запросы */
var lPanel = DOM.getById(pPanelID),
a = lPanel.getElementsByTagName('a'),
a = DOM.getByTag('a', lPanel),
/* right mouse click function varible */
lOnContextMenu_f = function(pEvent){
@ -487,17 +487,17 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
lUrl = CloudCmd.HOST,
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);
/* ставим загрузку гифа на клик*/
DOM.addClickListener( CloudCmd.refresh, lParent );
})(a);
CloudCmd.refresh = function(){
var lNEEDREFRESH = true,
lPath = DOM.getCurrentDirPath(),
lLink = CloudFunc.FS + lPath,
lNotSlashlLink = CloudFunc.removeLastSlash(lLink),
lLoad = CloudCmd.loadDir(lNotSlashlLink, lNEEDREFRESH);
lLoad();
};
/* ставим загрузку гифа на клик*/
DOM.addClickListener( CloudCmd.refresh, a[0].parentElement );
/* start from 1 cous 0 is a path and it's setted up */
for(var i = 1, n = a.length; i < n ; i++){
@ -554,8 +554,6 @@ var Util, DOM, CloudFunc, $, KeyBinding, CloudCommander;
if(lCleanPath === lSLASH)
lNOJSPath = lSLASH;
else
lCleanPath += lSLASH;
Util.log ('reading dir: "' + lCleanPath + '";');