From 20b98e565e704ab27d8745a8dcc852b4ee3effc4 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 12 May 2018 00:20:50 +0200 Subject: slightly cleaner audio/files behavior --- public/assets/js/lib/views/details/files.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'public/assets/js/lib/views/details/files.js') diff --git a/public/assets/js/lib/views/details/files.js b/public/assets/js/lib/views/details/files.js index 3cfd1c9..00ca201 100644 --- a/public/assets/js/lib/views/details/files.js +++ b/public/assets/js/lib/views/details/files.js @@ -20,8 +20,10 @@ var FilesView = FormView.extend({ this.$el.hide() } var total = 0, has_music = false - this.files = files - files.forEach(function(file){ + + this.files = files || this.files + this.thread = thread || this.thread + this.files.forEach(function(file){ if (is_image(file.filename)) { // return } @@ -36,7 +38,8 @@ var FilesView = FormView.extend({ audio.init() } - this.resort(thread.settings.sort || "name_asc") + const sort = this.thread.settings.sort || "name_asc" + this.resort(sort) }, files: [], -- cgit v1.2.3-70-g09d2