mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
Move template loading to directive of customer search override
This commit is contained in:
@@ -3,6 +3,9 @@ angular.module("admin.orders").directive 'customerSearchOverride', ->
|
||||
scope:
|
||||
distributorId: '@'
|
||||
link: (scope, element, attr) ->
|
||||
if $('#customer_autocomplete_template').length > 0
|
||||
customerTemplate = Handlebars.compile($('#customer_autocomplete_template').text())
|
||||
|
||||
formatCustomerResult = (customer) ->
|
||||
customerTemplate
|
||||
customer: customer
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
$(document).ready(function() {
|
||||
if ($('#customer_autocomplete_template').length > 0) {
|
||||
window.customerTemplate = Handlebars.compile($('#customer_autocomplete_template').text());
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user