feature(file) add data-name

This commit is contained in:
coderaiser 2015-05-22 06:25:09 -04:00
parent 677553f5f0
commit 4e7d460716
2 changed files with 11 additions and 11 deletions

View file

@ -1,7 +1,7 @@
<{{ tag }} {{ attribute }}class="{{ className }}">
<span class="mini-icon {{ type }}"></span>
<span class="name reduce-text">{{ name }}</span>
<span class="size reduce-text">{{ size }}</span>
<span class="owner reduce-text">{{ owner }}</span>
<span class="mode reduce-text">{{ mode }}</span>
<span data-name="js-type" class="mini-icon {{ type }}"></span>
<span data-name="js-name" class="name reduce-text">{{ name }}</span>
<span data-name="js-size" class="size reduce-text">{{ size }}</span>
<span data-name="js-owner" class="owner reduce-text">{{ owner }}</span>
<span data-name="js-mode" class="mode reduce-text">{{ mode }}</span>
</{{ tag }}>

View file

@ -98,7 +98,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
current = DOM.getRefreshButton().parentElement;
} else {
current = DOM.getCurrentFile();
current = DOM.getByClass('name', current);
current = DOM.getByDataName('js-name', current);
}
if (!parent || (parent && parent !== current))
@ -771,7 +771,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
*/
this.getCurrentSize = function(currentFile) {
var current = currentFile || Cmd.getCurrentFile(),
size = this.getByClass('size', current);
size = this.getByDataName('js-size', current);
/* если это папка - возвращаем слово dir вместо размера*/
size = size
@ -838,7 +838,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
*/
this.setCurrentSize = function(size, currentFile) {
var current = currentFile || this.getCurrentFile(),
sizeElement = this.getByClass('size', current);
sizeElement = this.getByDataName('js-size', current);
sizeElement.textContent = size;
@ -850,7 +850,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
this.getCurrentMode = function(currentFile) {
var ret,
current = currentFile || this.getCurrentFile(),
lMode = this.getByClass('mode', current);
lMode = this.getByDataName('js-mode', current);
ret = lMode.textContent;
return ret;
@ -862,7 +862,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
this.getCurrentOwner = function(currentFile) {
var ret,
current = currentFile || this.getCurrentFile(),
owner = this.getByClass('owner', current);
owner = this.getByDataName('js-owner', current);
ret = owner.textContent;
@ -1181,7 +1181,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
*/
this.isCurrentIsDir = function(currentFile) {
var current = currentFile || this.getCurrentFile(),
fileType = this.getByClass('mini-icon', current),
fileType = this.getByDataName('js-type', current),
ret = this.isContainClass(fileType, 'directory');
return ret;