Move template loading to directive of customer search override

This commit is contained in:
luisramos0
2019-12-28 20:02:44 +00:00
parent 7eba657b2f
commit 61ecca7257
2 changed files with 3 additions and 5 deletions

View File

@@ -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

View File

@@ -1,5 +0,0 @@
$(document).ready(function() {
if ($('#customer_autocomplete_template').length > 0) {
window.customerTemplate = Handlebars.compile($('#customer_autocomplete_template').text());
}
});