From 1da1296729425a4306bfb34e184efc16dd046c30 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 22 Jan 2014 15:39:25 +0100 Subject: [PATCH] Improved/added default sort by of result of search(). --- .../javascripts/app/models/_application_model.js.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/models/_application_model.js.coffee b/app/assets/javascripts/app/models/_application_model.js.coffee index 24a1f8994..3a05d155a 100644 --- a/app/assets/javascripts/app/models/_application_model.js.coffee +++ b/app/assets/javascripts/app/models/_application_model.js.coffee @@ -236,15 +236,18 @@ class App.Model extends Spine.Model item_new = @find( item.id ) all_complied.push @_fillUp(item_new) + # filter search if params.filter all_complied = @_filter( all_complied, params.filter ) + # use extend filter search if params.filterExtended all_complied = @_filterExtended( all_complied, params.filterExtended ) - if params.sortBy - all_complied = @_sortBy( all_complied, params.sortBy ) + # sort by + all_complied = @_sortBy( all_complied, params.sortBy ) + # order if params.order all_complied = @_order( all_complied, params.order )