Optionally hide folders in the main view.

This commit is contained in:
Lars Jung 2013-08-31 17:47:35 +02:00
parent fef8e2a254
commit 5c5d050218
2 changed files with 10 additions and 3 deletions

View File

@ -4,6 +4,7 @@ modulejs.define('view/items', ['_', '$', 'core/settings', 'core/resource', 'core
var settings = _.extend({
setParentFolderLabels: false,
hideParentFolderLinks: false,
hideFolders: false,
binaryPrefix: false
}, allsettings.view),
@ -106,7 +107,9 @@ modulejs.define('view/items', ['_', '$', 'core/settings', 'core/resource', 'core
_.each(item.content, function (e) {
$items.append(update(e, true));
if (!(e.isFolder() && settings.hideFolders)) {
$items.append(update(e, true));
}
});
if (item.isEmpty()) {
@ -123,7 +126,9 @@ modulejs.define('view/items', ['_', '$', 'core/settings', 'core/resource', 'core
_.each(added, function (item) {
update(item, true).hide().appendTo($items).fadeIn(400);
if (!(item.isFolder() && settings.hideFolders)) {
update(item, true).hide().appendTo($items).fadeIn(400);
}
});
_.each(removed, function (item) {

View File

@ -34,7 +34,8 @@ Options
The user selected view mode is also stored local in modern browsers
so that it will be persistent.
- setParentFolderLabels: set parent folder labels to real folder names
- hideParentFolderLinks: hide parent folder links
- hideParentFolderLinks: hide parent folder links in the main view
- hideFolders: hide all folders in the main view
- binaryPrefix: set to true uses 1024B=1KiB when formatting file sizes (see http://en.wikipedia.org/wiki/Binary_prefix)
- indexFiles: consider folder with those files as non {{pkg.name}} folders
- ignore: don't list items matching these regular expressions
@ -46,6 +47,7 @@ Options
"sizes": [48, 24, 96],
"setParentFolderLabels": true,
"hideParentFolderLinks": false,
"hideFolders": false,
"binaryPrefix": false,
"indexFiles": ["index.html", "index.htm", "index.php"],
"ignore": ["^\\.", "^_{{pkg.name}}"],