Select the element after clicking 'show in folder' in the drive search

pull/1/head
yflory 7 years ago
parent 5c405090e1
commit a1e7bf701d

@ -446,6 +446,7 @@ define([
res.forEach(function (l) { res.forEach(function (l) {
//var paths = findFile(l); //var paths = findFile(l);
ret.push({ ret.push({
id: l,
paths: findFile(l), paths: findFile(l),
data: exp.getFileData(l) data: exp.getFileData(l)
}); });

@ -1198,6 +1198,13 @@ define([
draggable: true, draggable: true,
'class': 'element-row' 'class': 'element-row'
}); });
if (!isFolder && Array.isArray(APP.selectedFiles)) {
var idx = APP.selectedFiles.indexOf(element);
if (idx !== -1) {
$element.addClass('selected');
APP.selectedFiles.splice(idx, 1);
}
}
if (isFolder) { if (isFolder) {
addFolderData(element, key, $element); addFolderData(element, key, $element);
} else { } else {
@ -1751,6 +1758,13 @@ define([
'class': 'file-element element element-row' + roClass, 'class': 'file-element element element-row' + roClass,
draggable: draggable draggable: draggable
}); });
if (Array.isArray(APP.selectedFiles)) {
var idx = APP.selectedFiles.indexOf(id);
if (idx !== -1) {
$element.addClass('selected');
APP.selectedFiles.splice(idx, 1);
}
}
addFileData(id, $element); addFileData(id, $element);
$element.prepend($icon).dblclick(function () { $element.prepend($icon).dblclick(function () {
openFile(id); openFile(id);
@ -1864,6 +1878,7 @@ define([
e.preventDefault(); e.preventDefault();
if (filesOp.isInTrashRoot(parentPath)) { parentPath = [TRASH]; } if (filesOp.isInTrashRoot(parentPath)) { parentPath = [TRASH]; }
else { parentPath.pop(); } else { parentPath.pop(); }
APP.selectedFiles = [r.id];
module.displayDirectory(parentPath); module.displayDirectory(parentPath);
}); });
} }

Loading…
Cancel
Save