Commit f9e93730 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

FileManager: fixed info dialog generation

was bugged when only a single items was selected
parent e4b669bf
......@@ -276,13 +276,14 @@ define([
},
run: function (info) {
var summary;
if (info.items && info.items.length > 1) {
var it = this.items(info);
if (it.length > 1) {
var nf = 0, nd = 0, ns = 0, ts = 0;
info.items.forEach(function (it) {
if (it.type == "f") nf++;
if (it.type == "d") nd++;
if (it.symlink) ns++;
if (it.type == "f" && !it.symlink) ts += it.size;
it.forEach(function (i) {
if (i.type == "f") nf++;
if (i.type == "d") nd++;
if (i.symlink) ns++;
if (i.type == "f" && !i.symlink) ts += i.size;
});
summary = {
size: ts,
......@@ -291,13 +292,13 @@ define([
symlinks: ns,
};
} else
summary = info.data;
summary = $.extend({}, it[0]);
summary.pathBase = info.pathBase;
new InfoDialog({
data: {
summary: summary,
title: info.data ? info.data.name : (info.items.length + " items"),
title: (it.length == 1) ? it[0].name : (it.length + " items"),
body: true,
buttons: {
close: {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment