summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/index/threadbox.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-14 18:54:22 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-14 18:54:22 +0200
commite79bdedb819415792eea49de7483885046d2a368 (patch)
tree9931fa389c1459347593155dd09a7c2cf3ecc009 /public/assets/js/lib/views/index/threadbox.js
parentafd20e776ba207be9c4a00d29cb61dd3ea760eef (diff)
change password form working
Diffstat (limited to 'public/assets/js/lib/views/index/threadbox.js')
-rw-r--r--public/assets/js/lib/views/index/threadbox.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/public/assets/js/lib/views/index/threadbox.js b/public/assets/js/lib/views/index/threadbox.js
index e3a5193..34974b7 100644
--- a/public/assets/js/lib/views/index/threadbox.js
+++ b/public/assets/js/lib/views/index/threadbox.js
@@ -40,9 +40,18 @@ var ThreadBox = View.extend({
})
Object.keys(keywords).sort().forEach((keyword) => {
this.appendKeyword({ keyword })
- this.appendThreads(keywords[keyword].sort( (a,b) => {
- return a.title.localeCompare(b.title) // b.lastmodified - a.lastmodified
- }))
+ switch (data.sort) {
+ case 'date':
+ this.appendThreads(keywords[keyword].sort( (a,b) => {
+ return b.lastmodified - a.lastmodified
+ }))
+ break
+ default:
+ this.appendThreads(keywords[keyword].sort( (a,b) => {
+ return a.title.localeCompare(b.title)
+ }))
+ break
+ }
})
}
if (is_mobile || window.innerWidth < 700) {