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

View file

@ -34,7 +34,8 @@ Options
The user selected view mode is also stored local in modern browsers The user selected view mode is also stored local in modern browsers
so that it will be persistent. so that it will be persistent.
- setParentFolderLabels: set parent folder labels to real folder names - 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) - 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 - indexFiles: consider folder with those files as non {{pkg.name}} folders
- ignore: don't list items matching these regular expressions - ignore: don't list items matching these regular expressions
@ -46,6 +47,7 @@ Options
"sizes": [48, 24, 96], "sizes": [48, 24, 96],
"setParentFolderLabels": true, "setParentFolderLabels": true,
"hideParentFolderLinks": false, "hideParentFolderLinks": false,
"hideFolders": false,
"binaryPrefix": false, "binaryPrefix": false,
"indexFiles": ["index.html", "index.htm", "index.php"], "indexFiles": ["index.html", "index.htm", "index.php"],
"ignore": ["^\\.", "^_{{pkg.name}}"], "ignore": ["^\\.", "^_{{pkg.name}}"],