Skip to content

Commit 230a4f5

Browse files
Phaze-IIIgstrauss
authored andcommitted
[mod_dirlisting] Swap A(scending) and D(escending) values (A=0, D=1)
x-ref: [mod_dirlisting] Fixes for mtime sorting and query parameter sort order #141 github: closes #141
1 parent 8803fba commit 230a4f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mod_dirlisting.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ static const char js_simple_table_resort[] = \
823823
/* portions copied from mod_dirlist (lighttpd2) */
824824
static const char js_simple_table_init_sort[] = \
825825
"\n" \
826-
"function init_sort(init_sort_column, ascending) {\n" \
826+
"function init_sort(init_sort_column, descending) {\n" \
827827
" var tables = document.getElementsByTagName(\"table\");\n" \
828828
" for (var i = 0; i < tables.length; i++) {\n" \
829829
" var table = tables[i];\n" \
@@ -847,7 +847,7 @@ static const char js_simple_table_init_sort[] = \
847847
" }\n" \
848848
" }\n" \
849849
" var lnk = row[init_sort_column].firstChild;\n" \
850-
" if (ascending) {\n" \
850+
" if (descending) {\n" \
851851
" var span = lnk.childNodes[1];\n" \
852852
" span.setAttribute('sortdir','down');\n" \
853853
" }\n" \
@@ -868,8 +868,8 @@ static const char js_simple_table_init_sort[] = \
868868
" case \"D\": c=3; break;\n" \
869869
" }\n" \
870870
" switch (urlParams.get('O')) {\n" \
871-
" case \"A\": o=1; break;\n" \
872-
" case \"D\": o=0; break;\n" \
871+
" case \"A\": o=0; break;\n" \
872+
" case \"D\": o=1; break;\n" \
873873
" }\n" \
874874
" init_sort(c,o);\n" \
875875
"}\n" \

0 commit comments

Comments
 (0)