diff --git a/app/assets/javascripts/admin/utils/directives/tags_with_translation.js.coffee b/app/assets/javascripts/admin/utils/directives/tags_with_translation.js.coffee index a356a9e4ff..221ee03c76 100644 --- a/app/assets/javascripts/admin/utils/directives/tags_with_translation.js.coffee +++ b/app/assets/javascripts/admin/utils/directives/tags_with_translation.js.coffee @@ -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" diff --git a/app/assets/javascripts/templates/admin/tags_input.html.haml b/app/assets/javascripts/templates/admin/tags_input.html.haml index 3e02c1c332..15a69b650c 100644 --- a/app/assets/javascripts/templates/admin/tags_input.html.haml +++ b/app/assets/javascripts/templates/admin/tags_input.html.haml @@ -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",