From 626c8563f2963d8df90f6f184986a649677ea146 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 4 Jun 2014 22:41:40 +0200 Subject: [PATCH] Add option where to place folders. --- CHANGELOG.md | 3 ++- src/_h5ai/client/js/inc/ext/sort.js | 8 +++++++- src/_h5ai/conf/options.json | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c895be4e..0f967864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ * adds icons from [Evolvere Icon Theme](http://franksouza183.deviantart.com/art/Evolvere-Icon-theme-440718295) * adds PHP variant to calc folder sizes * adds scroll position reset on location change (issue [#279](https://github.com/lrsjng/h5ai/issues/279)) -* adds "hide if 403" option +* adds option to hide unreadable files +* adds option where to place folders (top, inplace, bottom) * fixes QR code URI origin (issue [#287](https://github.com/lrsjng/h5ai/issues/287)) * adds Google UA support * extends selectable icon sizes (adds 128px, 192px, 256px, 384px) diff --git a/src/_h5ai/client/js/inc/ext/sort.js b/src/_h5ai/client/js/inc/ext/sort.js index 4d99a698..68a51795 100644 --- a/src/_h5ai/client/js/inc/ext/sort.js +++ b/src/_h5ai/client/js/inc/ext/sort.js @@ -6,7 +6,8 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/e column: 0, reverse: false, ignorecase: true, - natural: false + natural: false, + folders: 0 }, allsettings.sort), storekey = 'ext/sort', @@ -21,6 +22,11 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/e return 0; } if ($item.hasClass('folder')) { + if (settings.folders === 1) { + return 2; + } else if (settings.folders === 2) { + return 3; + } return 1; } return 2; diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json index 3d4adff1..1d3cacbf 100644 --- a/src/_h5ai/conf/options.json +++ b/src/_h5ai/conf/options.json @@ -305,13 +305,15 @@ Options - reverse: boolean, false for ascending, true for descending - ignorecase: boolean, compare ignorecase - natural: boolean, use natural sort order + - folders: where to place folders, 0 for "top", 1 for "in place", 2 for "bottom" */ "sort": { "enabled": true, "column": 0, "reverse": false, "ignorecase": true, - "natural": false + "natural": false, + "folders": 0 }, /*