mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Change the way changes to underlying model are watched and updated for select2 elements
This commit is contained in:
@@ -4,5 +4,6 @@ angular.module("admin.indexUtils").directive "select2MinSearch", ($timeout) ->
|
||||
element.select2
|
||||
minimumResultsForSearch: attrs.select2MinSearch
|
||||
|
||||
scope.$watch attrs.ngModel, (newVal, oldVal) ->
|
||||
$timeout -> element.trigger('change')
|
||||
ngModel.$formatters.push (value) ->
|
||||
element.select2('val', value)
|
||||
value
|
||||
|
||||
Reference in New Issue
Block a user