mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
Trigger a digest cycle when opening modals with dynamic content
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
angular.module("admin.customers").directive 'editAddressDialog', ($compile, $templateCache, DialogDefaults, Customers, StatusMessage, CountryStates) ->
|
||||
angular.module("admin.customers").directive 'editAddressDialog', ($rootScope, $compile, $templateCache, DialogDefaults, Customers, StatusMessage, CountryStates) ->
|
||||
restrict: 'A'
|
||||
scope: true
|
||||
link: (scope, element, attr) ->
|
||||
@@ -18,6 +18,7 @@ angular.module("admin.customers").directive 'editAddressDialog', ($compile, $tem
|
||||
scope.customer = data
|
||||
scope.errors = []
|
||||
template.dialog('close')
|
||||
$rootScope.$evalAsync()
|
||||
StatusMessage.display('success', t('admin.customers.index.update_address_success'))
|
||||
else
|
||||
scope.errors.push(t('admin.customers.index.update_address_error'))
|
||||
@@ -33,4 +34,4 @@ angular.module("admin.customers").directive 'editAddressDialog', ($compile, $tem
|
||||
template = $compile($templateCache.get('admin/edit_address_dialog.html'))(scope)
|
||||
template.dialog(DialogDefaults)
|
||||
template.dialog('open')
|
||||
scope.$apply()
|
||||
$rootScope.$evalAsync()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $templateCache, DialogDefaults, CurrentShop, Customers) ->
|
||||
angular.module("admin.customers").directive 'newCustomerDialog', ($rootScope, $compile, $templateCache, DialogDefaults, CurrentShop, Customers) ->
|
||||
restrict: 'A'
|
||||
scope: true
|
||||
link: (scope, element, attr) ->
|
||||
@@ -20,6 +20,7 @@ angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $tem
|
||||
scope.email = ""
|
||||
scope.submitted = false
|
||||
template.dialog('close')
|
||||
$rootScope.$evalAsync()
|
||||
, (response) ->
|
||||
if response.data.errors
|
||||
scope.errors.push(error) for error in response.data.errors
|
||||
@@ -37,5 +38,6 @@ angular.module("admin.customers").directive 'newCustomerDialog', ($compile, $tem
|
||||
element.bind 'click', (e) ->
|
||||
if CurrentShop.shop.id
|
||||
template.dialog('open')
|
||||
$rootScope.$evalAsync()
|
||||
else
|
||||
alert(t('js.customers.select_shop'))
|
||||
|
||||
Reference in New Issue
Block a user