Permalink
Browse files

Optionally hide folders in the main view.

  • Loading branch information...
1 parent fef8e2a commit 5c5d050218b9b171497d85e5c740a5fde6961ca8 @lrsjng committed Aug 31, 2013
Showing with 10 additions and 3 deletions.
  1. +7 −2 src/_h5ai/client/js/inc/view/items.js
  2. +3 −1 src/_h5ai/conf/options.json
@@ -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) {
@@ -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}}"],

0 comments on commit 5c5d050

Please sign in to comment.