mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
Optional autocomplete for tag rules directive
This commit is contained in:
@@ -8,6 +8,8 @@ angular.module("admin.utils").directive "tagsWithTranslation", ($timeout) ->
|
||||
findTags: "&"
|
||||
form: '=?'
|
||||
link: (scope, element, attrs) ->
|
||||
scope.findTags = undefined unless attrs.hasOwnProperty("findTags")
|
||||
|
||||
$timeout ->
|
||||
scope.tagsAttr ||= "tags"
|
||||
scope.tagListAttr ||= "tag_list"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%tags-input{ template: 'admin/tag.html', ng: { model: 'object[tagsAttr]' }, on: { tag: { added: 'tagAdded()', removed:'tagRemoved()' } } }
|
||||
%auto-complete{source: "findTags({query: $query})",
|
||||
%auto-complete{ ng: { if: "findTags" }, source: "findTags({query: $query})",
|
||||
template: "admin/tag_autocomplete.html",
|
||||
"min-length" => "0",
|
||||
"load-on-focus" => "true",
|
||||
|
||||
Reference in New Issue
Block a user