Moving taxons into its own module, adding preferred shopfront taxon order to enterprise

This commit is contained in:
Rob Harrington
2014-12-18 16:50:47 +11:00
parent a38e27e504
commit f145a7ed65
12 changed files with 32 additions and 12 deletions

View File

@@ -1,15 +0,0 @@
angular.module("ofn.admin").factory "Taxons", (taxons, $filter) ->
new class Taxons
constructor: ->
@taxons = taxons
# For finding a single Taxon
findByID: (id) ->
$filter('filter')(@taxons, {id: id}, true)[0]
# For finding multiple Taxons represented by comma delimited string
findByIDs: (ids) ->
taxon for taxon in @taxons when taxon.id.toString() in ids.split(",")
findByTerm: (term) ->
$filter('filter')(@taxons, term)