mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Replace disable-dynamically angular directive
This commit is contained in:
committed by
Filipe
parent
23c9410a25
commit
32e3fc0175
@@ -1,14 +0,0 @@
|
||||
# Allows disabling of link buttons via disabled attribute.
|
||||
# This is normally ignored, ie the link appears disabled but is still clickable.
|
||||
|
||||
angular.module('Darkswarm').directive "disableDynamically", ->
|
||||
restrict: 'A'
|
||||
|
||||
link: (scope, element, attrs) ->
|
||||
element.on 'click', (e) ->
|
||||
if attrs.disabled
|
||||
e.preventDefault()
|
||||
return
|
||||
|
||||
scope.$on "$destroy", ->
|
||||
element.off("click")
|
||||
@@ -1,5 +1,5 @@
|
||||
.row.links
|
||||
%a.continue-shopping.button.secondary{href: current_shop_products_path, "ng-disabled" => "#{@insufficient_stock_lines.any?}", "disable-dynamically" => true}
|
||||
%a.continue-shopping.button.secondary{ @insufficient_stock_lines.any? ? { disabled: "disabled" } : { href: current_shop_products_path } }
|
||||
= t :orders_edit_continue
|
||||
%a#checkout-link.button.primary.right{href: main_app.checkout_path, "ng-disabled" => "#{@insufficient_stock_lines.any?}", "disable-dynamically" => true}
|
||||
%a#checkout-link.button.primary.right{ @insufficient_stock_lines.any? ? { disabled: "disabled" } : { href: main_app.checkout_path } }
|
||||
= t :orders_edit_checkout
|
||||
|
||||
Reference in New Issue
Block a user