mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Adding placeholder field with default to ofn-select2 component
This commit is contained in:
@@ -14,6 +14,7 @@ angular.module("admin.utils").directive "ofnSelect2", ($sanitize, $timeout, $fil
|
||||
scope.text ?= 'name'
|
||||
scope.multiple ?= false
|
||||
scope.filter ?= -> true
|
||||
scope.placeholder ?= t('admin.choose')
|
||||
|
||||
if scope.data.$promise
|
||||
scope.data.$promise.then -> init()
|
||||
@@ -39,6 +40,7 @@ angular.module("admin.utils").directive "ofnSelect2", ($sanitize, $timeout, $fil
|
||||
item.name = $sanitize(item.name) for item in scope.data
|
||||
element.select2
|
||||
multiple: scope.multiple
|
||||
placeholder: scope.placeholder
|
||||
minimumResultsForSearch: scope.minSearch || 0
|
||||
data: ->
|
||||
filtered = $filter('filter')(scope.data,scope.filter)
|
||||
|
||||
@@ -237,6 +237,7 @@ en:
|
||||
show_more: Show more
|
||||
show_n_more: Show %{num} more
|
||||
choose: "Choose..."
|
||||
please_select: Please select...
|
||||
|
||||
columns: Columns
|
||||
actions: Actions
|
||||
|
||||
Reference in New Issue
Block a user