Highlight update button when cart page form is "dirty"

This commit is contained in:
Matt-Yorkley
2020-05-15 10:27:58 +02:00
parent 73b533690e
commit 42195b76d3
3 changed files with 5 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
Darkswarm.controller "CartFormCtrl", ($scope) ->

View File

@@ -33,7 +33,8 @@
- else
%div{"data-hook" => "outside_cart_form"}
= form_for @order, :url => main_app.update_cart_path, :html => {:id => 'update-cart'} do |order_form|
= form_for @order, :url => main_app.update_cart_path,
:html => {id: 'update-cart', name: "form", "ng-controller"=> 'CartFormCtrl'} do |order_form|
%div{"data-hook" => "inside_cart_form"}
%div{"data-hook" => "cart_items"}
.row

View File

@@ -1,7 +1,7 @@
%tr
%td{colspan:"2"}
%td
%button#update-button.secondary.radius.expand.small
%button#update-button.secondary.radius.expand.small{"ng-class" => "{ alert: form.$dirty }"}
%i.ofn-i_023-refresh
= t(:update)
%td