mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
Making TagRule autocomplete available to models other than Customer
Incorporate ng admin.tags module and rails TagController into existing admin.tagRules module + TagRuleController
This commit is contained in:
@@ -1,2 +1,10 @@
|
||||
angular.module("admin.shippingMethods").controller "shippingMethodCtrl", ($scope, shippingMethod) ->
|
||||
angular.module("admin.shippingMethods").controller "shippingMethodCtrl", ($scope, shippingMethod, TagRuleResource, $q) ->
|
||||
$scope.shippingMethod = shippingMethod
|
||||
|
||||
$scope.findTags = (query) ->
|
||||
defer = $q.defer()
|
||||
TagRuleResource.mapByTag (data) =>
|
||||
filtered = data.filter (tag) ->
|
||||
tag.text.toLowerCase().indexOf(query.toLowerCase()) != -1
|
||||
defer.resolve filtered
|
||||
defer.promise
|
||||
|
||||
Reference in New Issue
Block a user