From c2951c7f6e6996db1cf10fb163e9ed83fc219190 Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Tue, 22 Mar 2016 15:26:10 +0100 Subject: [PATCH 1/2] Add submit button directive --- src/javascripts/ng-admin/Crud/CrudModule.js | 1 + src/javascripts/ng-admin/Crud/form/create.html | 2 +- src/javascripts/ng-admin/Crud/form/edit.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/javascripts/ng-admin/Crud/CrudModule.js b/src/javascripts/ng-admin/Crud/CrudModule.js index c4c666b1..cbeb3ed2 100644 --- a/src/javascripts/ng-admin/Crud/CrudModule.js +++ b/src/javascripts/ng-admin/Crud/CrudModule.js @@ -75,6 +75,7 @@ CrudModule.directive('maListButton', require('./button/maListButton')); CrudModule.directive('maDeleteButton', require('./button/maDeleteButton')); CrudModule.directive('maBatchDeleteButton', require('./button/maBatchDeleteButton')); CrudModule.directive('maExportToCsvButton', require('./button/maExportToCsvButton')); +CrudModule.directive('maSubmitButton', require('./button/maSubmitButton')); CrudModule.directive('maViewBatchActions', require('./button/maViewBatchActions')); CrudModule.directive('maShowItem', require('./show/maShowItem')); diff --git a/src/javascripts/ng-admin/Crud/form/create.html b/src/javascripts/ng-admin/Crud/form/create.html index 22996ed1..dfc453ae 100644 --- a/src/javascripts/ng-admin/Crud/form/create.html +++ b/src/javascripts/ng-admin/Crud/form/create.html @@ -20,7 +20,7 @@

- +
diff --git a/src/javascripts/ng-admin/Crud/form/edit.html b/src/javascripts/ng-admin/Crud/form/edit.html index 8d084587..67ccfbed 100644 --- a/src/javascripts/ng-admin/Crud/form/edit.html +++ b/src/javascripts/ng-admin/Crud/form/edit.html @@ -21,7 +21,7 @@

- +
From e2623d5571721b1351561bb6474862a8a32b7e4c Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Tue, 22 Mar 2016 15:31:53 +0100 Subject: [PATCH 2/2] Forgot the new directive --- .../ng-admin/Crud/button/maSubmitButton.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/javascripts/ng-admin/Crud/button/maSubmitButton.js diff --git a/src/javascripts/ng-admin/Crud/button/maSubmitButton.js b/src/javascripts/ng-admin/Crud/button/maSubmitButton.js new file mode 100644 index 00000000..38001130 --- /dev/null +++ b/src/javascripts/ng-admin/Crud/button/maSubmitButton.js @@ -0,0 +1,20 @@ +/** + * Save button + * + * Usage: + * + */ +export default function maSubmitButtonDirective() { + return { + restrict: 'E', + scope: { + label: '@', + }, + link: function (scope) { + scope.label = scope.label || 'Save'; + }, + template: '' + }; +} + +maSubmitButtonDirective.$inject = [];