|
|
@ -1159,11 +1159,18 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
// The element with the class '.name' is underlined when the 'li' is hovered
|
|
|
|
// The element with the class '.name' is underlined when the 'li' is hovered
|
|
|
|
var $name = $('<span>', {'class': 'cp-app-drive-element-name'}).text(name);
|
|
|
|
var $name = $('<span>', {'class': 'cp-app-drive-element-name'}).text(name);
|
|
|
|
$span.html('');
|
|
|
|
|
|
|
|
$span.append($name);
|
|
|
|
$span.append($name);
|
|
|
|
$span.append($state);
|
|
|
|
$span.append($state);
|
|
|
|
|
|
|
|
|
|
|
|
var type = Messages.type[hrefData.type] || hrefData.type;
|
|
|
|
var type = Messages.type[hrefData.type] || hrefData.type;
|
|
|
|
|
|
|
|
common.displayThumbnail(data.href, $span, function ($thumb) {
|
|
|
|
|
|
|
|
// Called only if the thumbnail exists
|
|
|
|
|
|
|
|
// Remove the .hide() added by displayThumnail() because it hides the icon in
|
|
|
|
|
|
|
|
// list mode too
|
|
|
|
|
|
|
|
$span.find('.cp-icon').removeAttr('style').addClass('cp-app-drive-element-list');
|
|
|
|
|
|
|
|
$thumb.addClass('cp-app-drive-element-grid')
|
|
|
|
|
|
|
|
.addClass('cp-app-drive-element-thumbnail');
|
|
|
|
|
|
|
|
});
|
|
|
|
var $type = $('<span>', {
|
|
|
|
var $type = $('<span>', {
|
|
|
|
'class': 'cp-app-drive-element-type cp-app-drive-element-list'
|
|
|
|
'class': 'cp-app-drive-element-type cp-app-drive-element-list'
|
|
|
|
}).text(type);
|
|
|
|
}).text(type);
|
|
|
@ -1181,7 +1188,6 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
var addFolderData = function (element, key, $span) {
|
|
|
|
var addFolderData = function (element, key, $span) {
|
|
|
|
if (!element || !filesOp.isFolder(element)) { return; }
|
|
|
|
if (!element || !filesOp.isFolder(element)) { return; }
|
|
|
|
$span.html('');
|
|
|
|
|
|
|
|
// The element with the class '.name' is underlined when the 'li' is hovered
|
|
|
|
// The element with the class '.name' is underlined when the 'li' is hovered
|
|
|
|
var sf = filesOp.hasSubfolder(element);
|
|
|
|
var sf = filesOp.hasSubfolder(element);
|
|
|
|
var files = filesOp.hasFile(element);
|
|
|
|
var files = filesOp.hasFile(element);
|
|
|
@ -1239,11 +1245,6 @@ define([
|
|
|
|
APP.selectedFiles.splice(idx, 1);
|
|
|
|
APP.selectedFiles.splice(idx, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isFolder) {
|
|
|
|
|
|
|
|
addFolderData(element, key, $element);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
addFileData(element, $element);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$element.prepend($icon).dblclick(function () {
|
|
|
|
$element.prepend($icon).dblclick(function () {
|
|
|
|
if (isFolder) {
|
|
|
|
if (isFolder) {
|
|
|
|
APP.displayDirectory(newPath);
|
|
|
|
APP.displayDirectory(newPath);
|
|
|
@ -1252,6 +1253,11 @@ define([
|
|
|
|
if (isTrash) { return; }
|
|
|
|
if (isTrash) { return; }
|
|
|
|
openFile(root[key]);
|
|
|
|
openFile(root[key]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
if (isFolder) {
|
|
|
|
|
|
|
|
addFolderData(element, key, $element);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
addFileData(element, $element);
|
|
|
|
|
|
|
|
}
|
|
|
|
$element.addClass(liClass);
|
|
|
|
$element.addClass(liClass);
|
|
|
|
$element.data('path', newPath);
|
|
|
|
$element.data('path', newPath);
|
|
|
|
addDragAndDropHandlers($element, newPath, isFolder, !isTrash);
|
|
|
|
addDragAndDropHandlers($element, newPath, isFolder, !isTrash);
|
|
|
@ -1850,10 +1856,10 @@ define([
|
|
|
|
APP.selectedFiles.splice(sidx, 1);
|
|
|
|
APP.selectedFiles.splice(sidx, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
addFileData(id, $element);
|
|
|
|
|
|
|
|
$element.prepend($icon).dblclick(function () {
|
|
|
|
$element.prepend($icon).dblclick(function () {
|
|
|
|
openFile(id);
|
|
|
|
openFile(id);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
addFileData(id, $element);
|
|
|
|
var path = [rootName, idx];
|
|
|
|
var path = [rootName, idx];
|
|
|
|
$element.data('path', path);
|
|
|
|
$element.data('path', path);
|
|
|
|
$element.click(function(e) {
|
|
|
|
$element.click(function(e) {
|
|
|
@ -1886,12 +1892,12 @@ define([
|
|
|
|
var $element = $('<li>', {
|
|
|
|
var $element = $('<li>', {
|
|
|
|
'class': 'cp-app-drive-element cp-app-drive-element-row' + roClass
|
|
|
|
'class': 'cp-app-drive-element cp-app-drive-element-row' + roClass
|
|
|
|
});
|
|
|
|
});
|
|
|
|
addFileData(id, $element);
|
|
|
|
|
|
|
|
$element.data('path', [FILES_DATA, id]);
|
|
|
|
|
|
|
|
$element.data('element', id);
|
|
|
|
|
|
|
|
$element.prepend($icon).dblclick(function () {
|
|
|
|
$element.prepend($icon).dblclick(function () {
|
|
|
|
openFile(id);
|
|
|
|
openFile(id);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
addFileData(id, $element);
|
|
|
|
|
|
|
|
$element.data('path', [FILES_DATA, id]);
|
|
|
|
|
|
|
|
$element.data('element', id);
|
|
|
|
$element.click(function(e) {
|
|
|
|
$element.click(function(e) {
|
|
|
|
e.stopPropagation();
|
|
|
|
e.stopPropagation();
|
|
|
|
onElementClick(e, $element);
|
|
|
|
onElementClick(e, $element);
|
|
|
@ -2018,10 +2024,10 @@ define([
|
|
|
|
var $element = $('<li>', {
|
|
|
|
var $element = $('<li>', {
|
|
|
|
'class': 'cp-app-drive-element cp-app-drive-element-file cp-app-drive-element-row' + roClass,
|
|
|
|
'class': 'cp-app-drive-element cp-app-drive-element-file cp-app-drive-element-row' + roClass,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
addFileData(id, $element);
|
|
|
|
|
|
|
|
$element.prepend($icon).dblclick(function () {
|
|
|
|
$element.prepend($icon).dblclick(function () {
|
|
|
|
openFile(id);
|
|
|
|
openFile(id);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
addFileData(id, $element);
|
|
|
|
$element.data('path', path);
|
|
|
|
$element.data('path', path);
|
|
|
|
$element.click(function(e) {
|
|
|
|
$element.click(function(e) {
|
|
|
|
e.stopPropagation();
|
|
|
|
e.stopPropagation();
|
|
|
|