mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-19 04:49:15 +00:00
Replace directive with data-confirm
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
angular.module('Darkswarm').directive "confirmLinkClick", ($window) ->
|
||||
restrict: 'A'
|
||||
scope:
|
||||
confirmMsg: '@confirmLinkClick'
|
||||
link: (scope, elem, attr) ->
|
||||
elem.bind 'click', (event) ->
|
||||
unless confirm(scope.confirmMsg)
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
@@ -12,7 +12,7 @@
|
||||
- if order.changes_allowed?
|
||||
.columns.show-for-medium-up.medium-3
|
||||
.columns.small-12.medium-3
|
||||
= link_to main_app.cancel_order_path(@order), method: :put, :class => "button secondary expand", "confirm-link-click" => t('orders_confirm_cancel') do
|
||||
= link_to main_app.cancel_order_path(@order), method: :put, class: "button secondary expand", "data-confirm": t('orders_confirm_cancel') do
|
||||
%i.ofn-i_009-close
|
||||
= t(:cancel_order)
|
||||
.columns.small-12.medium-3
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
%td.order6.text-right.brick
|
||||
%a{"ng-href" => "{{::order.path}}" }= t('.edit')
|
||||
%td.order7.show-for-large-up.text-right
|
||||
= link_to t('.cancel'), "", method: :put, "ng-href" => "{{::order.cancel_path}}", "confirm-link-click" => t('orders_confirm_cancel')
|
||||
= link_to t('.cancel'), "", method: :put, "ng-href": "{{::order.cancel_path}}", "data-confirm": t('orders_confirm_cancel')
|
||||
|
||||
Reference in New Issue
Block a user