Replace directive with data-confirm

This commit is contained in:
Matt-Yorkley
2021-08-17 12:32:02 +01:00
parent 8bf3f72ad3
commit 086c5ab264
3 changed files with 2 additions and 11 deletions

View File

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

View File

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

View File

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