diff --git a/ChangeLog b/ChangeLog index 93c57c41..fa7b4749 100644 --- a/ChangeLog +++ b/ChangeLog @@ -128,6 +128,8 @@ getJSONfromFileTable. * fix(diff) rm, work bad with win line ending +* fix(dom) this -> Cmd + 2012.04.22, v0.2.0 diff --git a/lib/client/dom.js b/lib/client/dom.js index ead6b6fb..cd8f0fee 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1052,9 +1052,12 @@ var CloudCmd, Util, DOM, CloudFunc; lFiles = Cmd.getSelectedFiles(), lSelected = Cmd.getSelectedNames(lFiles), i, n = lSelected && lSelected.length; + + if ( !Cmd.isCurrentFile(pCurrentFile) ) + pCurrentFile = null; if (n > 1){ - for(i = 0; i < 5 && i < n; i++) + for (i = 0; i < 5 && i < n; i++) lName += '\n' + lSelected[i]; if (n >= 5) @@ -1066,12 +1069,12 @@ var CloudCmd, Util, DOM, CloudFunc; var lType, lIsDir; /* dom element passed and it is not event */ - if ( pCurrentFile && !pCurrentFile.pType) + if (pCurrentFile && !pCurrentFile.pType) lCurrent = pCurrentFile; else - lCurrent = this.getCurrentFile(); + lCurrent = Cmd.getCurrentFile(); - lIsDir = this.isCurrentIsDir(lCurrent); + lIsDir = Cmd.isCurrentIsDir(lCurrent); if (lIsDir){ lQuery = '?dir'; @@ -1082,7 +1085,7 @@ var CloudCmd, Util, DOM, CloudFunc; lType += ' '; - lName = this.getCurrentName(lCurrent); + lName = Cmd.getCurrentName(lCurrent); lMsg = lMsgAsk + lMsgSel + lType + lName + '?'; } @@ -1090,13 +1093,14 @@ var CloudCmd, Util, DOM, CloudFunc; lRet = confirm(lMsg); else alert('No files selected!'); - if (lRet){ + + if (lRet) { var lUrl; if (lCurrent) - lUrl = this.getCurrentPath(lCurrent); - else{ - lUrl = this.getCurrentDirPath(); + lUrl = Cmd.getCurrentPath(lCurrent); + else { + lUrl = Cmd.getCurrentDirPath(); lCurrent = lFiles[0]; } @@ -1671,9 +1675,9 @@ var CloudCmd, Util, DOM, CloudFunc; * @pCurrent */ this.deleteCurrent = function(pCurrent, pNextFile, pPreviousFile, pNotSet){ - var lCurrent = pCurrent || this.getCurrentFile(), + var lCurrent = pCurrent || Cmd.getCurrentFile(), lParent = lCurrent && lCurrent.parentElement, - lName = this.getCurrentName(lCurrent); + lName = Cmd.getCurrentName(lCurrent); if (lCurrent && lParent && lName !== '..'){ var lNext = pNextFile || lCurrent.nextSibling, @@ -1746,13 +1750,13 @@ var CloudCmd, Util, DOM, CloudFunc; * @pCurrent */ this.moveCurrent = function(pCurrentFile){ - if ( !this.isCurrentFile(pCurrentFile) ) + if ( !Cmd.isCurrentFile(pCurrentFile) ) pCurrentFile = null; - var lCurrent = pCurrentFile || this.getCurrentFile(), - lName = this.getCurrentName(lCurrent), - lFromPath = this.getCurrentPath(), - lToPath = this.getNotCurrentDirPath() + lName; + var lCurrent = pCurrentFile || Cmd.getCurrentFile(), + lName = Cmd.getCurrentName(lCurrent), + lFromPath = Cmd.getCurrentPath(), + lToPath = Cmd.getNotCurrentDirPath() + lName; lToPath = prompt( 'Rename/Move file "' + lName + '"', lToPath ); @@ -1780,13 +1784,13 @@ var CloudCmd, Util, DOM, CloudFunc; * @pCurrent */ this.copyCurrent = function(pCurrentFile){ - if ( !this.isCurrentFile(pCurrentFile) ) + if ( !Cmd.isCurrentFile(pCurrentFile) ) pCurrentFile = null; - var lCurrent = pCurrentFile || this.getCurrentFile(), - lName = this.getCurrentName(lCurrent), - lFromPath = this.getCurrentPath(), - lToPath = this.getNotCurrentDirPath() + lName; + var lCurrent = pCurrentFile || Cmd.getCurrentFile(), + lName = Cmd.getCurrentName(lCurrent), + lFromPath = Cmd.getCurrentPath(), + lToPath = Cmd.getNotCurrentDirPath() + lName; lToPath = prompt( 'Copy file "' + lName + '" to', lToPath ); if ( lToPath && !Util.strCmp(lFromPath, lToPath) ){