mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Clear coordinator fees when coordinator changes
This commit is contained in:
@@ -275,3 +275,9 @@ angular.module('order_cycle', ['ngResource'])
|
||||
parsed = $parse(attrs.datetimepicker)
|
||||
parsed.assign(scope, dateText)
|
||||
])
|
||||
|
||||
.directive('ofwOnChange', ->
|
||||
(scope, element, attrs) ->
|
||||
element.bind 'change', ->
|
||||
scope.$apply(attrs.ofwOnChange)
|
||||
)
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
%h2 Coordinator
|
||||
= f.label :coordinator_id, 'Coordinator'
|
||||
= f.collection_select :coordinator_id, coordinating_enterprises, :id, :name, {}, {'ng-model' => 'order_cycle.coordinator_id', 'required' => true}
|
||||
= f.collection_select :coordinator_id, coordinating_enterprises, :id, :name, {}, {'ng-model' => 'order_cycle.coordinator_id', 'ofw-on-change' => 'order_cycle.coordinator_fees = []', 'required' => true}
|
||||
|
||||
%table
|
||||
%tr{'ng-repeat' => 'enterprise_fee in order_cycle.coordinator_fees'}
|
||||
|
||||
Reference in New Issue
Block a user