feature(cloudfunc) buildFromJSON ul.files:add data-name

This commit is contained in:
coderaiser 2014-04-05 15:24:44 -04:00
parent 0f7d4a2e04
commit bd5e4d1499
2 changed files with 14 additions and 7 deletions

View file

@ -275,17 +275,24 @@ var CloudCmd, Util, DOM, CloudFunc, $;
}
function clickProcessing() {
var element, isCurrent,
layer = DOM.getById('context-menu-layer');
var element, isCurrent, parent, name,
layer = DOM.getById('context-menu-layer');
if (layer) {
DOM.hide(layer);
element = DOM.getCurrentByPosition(Position);
isCurrent = DOM.isCurrentFile(element);
element = DOM.getCurrentByPosition(Position);
if (element) {
parent = element.parentElement;
name = parent && parent.getAttribute('data-name');
if (!isCurrent)
DOM.setCurrentFile(element);
if (name === 'js-files') {
isCurrent = DOM.isCurrentFile(element);
if (!isCurrent)
DOM.setCurrentFile(element);
}
}
}
Key.setBind();

View file

@ -405,7 +405,7 @@ var Util;
/* сохраняем путь */
CloudFunc.Path = path;
fileTable += '<ul class="files">';
fileTable += '<ul data-name="js-files" class="files">';
/* Если мы не в корне */
if (path !== '/') {
/* убираем последний слеш и каталог в котором мы сейчас находимся*/