From 80da0d5330edf69a5ec1e3dc553264c5668cd146 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 4 Apr 2018 13:36:03 +1000 Subject: [PATCH] Set enterprise form dirty on any change Commit 4953c69123059e44f64d0a2ea24f001cd6b2dff4 introduced a bug that the save button is not activated when changing enterprise fields. https://github.com/openfoodfoundation/openfoodnetwork/issues/2195 This is reverting the change and fixes #2195. Sadly, it re-opens https://github.com/openfoodfoundation/openfoodnetwork/issues/1216. But that one is not as severe as the current bug. --- app/views/admin/enterprises/_ng_form.html.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/admin/enterprises/_ng_form.html.haml b/app/views/admin/enterprises/_ng_form.html.haml index fa97605104..44511d35ec 100644 --- a/app/views/admin/enterprises/_ng_form.html.haml +++ b/app/views/admin/enterprises/_ng_form.html.haml @@ -2,6 +2,7 @@ -# ng-change is only valid for inputs, not for a form. -# So we use onchange and have to get the scope to access the ng controller = form_for [main_app, :admin, @enterprise], html: { name: "enterprise_form", + onchange: "angular.element(enterprise_form).scope().setFormDirty()", "ng-controller" => 'enterpriseCtrl', "ng-cloak" => true } do |f|