From c003dcded9554cf56b563642fda3ab150cec0e4a Mon Sep 17 00:00:00 2001 From: Bing Xie Date: Fri, 27 May 2016 11:22:23 +1000 Subject: [PATCH] Update editing enterprise page save-bar --- app/views/admin/enterprises/_ng_form.html.haml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/admin/enterprises/_ng_form.html.haml b/app/views/admin/enterprises/_ng_form.html.haml index 3914cc1df2..ca38b7eca4 100644 --- a/app/views/admin/enterprises/_ng_form.html.haml +++ b/app/views/admin/enterprises/_ng_form.html.haml @@ -7,7 +7,11 @@ 'onchange' => 'angular.element(enterprise_form).scope().setFormDirty()', } do |f| - %save-bar{ buttons: "[{ text: 'Update', action: submit, param: null, class: 'red' }, { text: 'Cancel', action: cancel, param: '#{main_app.admin_enterprises_path}' }]", form: "enterprise_form" } + %save-bar{ dirty: "enterprise_form.$dirty", persist: "true" } + %input.red{ type: "button", value: "Update", ng: { click: "submit()", disabled: "!enterprise_form.$dirty" } } + %input{ type: "button", ng: { value: "enterprise_form.$dirty ? 'Cancel' : 'Close'", click: "cancel('#{main_app.admin_enterprises_path}')" } } + + .row .sixteen.columns.alpha