diff --git a/src/Umbraco.Web.UI.Client/bower.json b/src/Umbraco.Web.UI.Client/bower.json index d9a5c366a6..71b393ae9c 100644 --- a/src/Umbraco.Web.UI.Client/bower.json +++ b/src/Umbraco.Web.UI.Client/bower.json @@ -41,7 +41,8 @@ "clipboard": "~2.0.0", "font-awesome": "~4.2", "animejs": "^2.2.0", - "angular-ui-sortable": "0.14.3" + "angular-ui-sortable": "0.14.3", + "angular-messages": "^1.7.2" }, "install": { "path": "lib-bower", diff --git a/src/Umbraco.Web.UI.Client/src/app.js b/src/Umbraco.Web.UI.Client/src/app.js index 81230c73f3..a4ed9669c5 100644 --- a/src/Umbraco.Web.UI.Client/src/app.js +++ b/src/Umbraco.Web.UI.Client/src/app.js @@ -10,7 +10,8 @@ var app = angular.module('umbraco', [ 'ngAnimate', 'ngCookies', 'ngSanitize', - 'ngTouch', + 'ngTouch', + 'ngMessages', 'tmh.dynamicLocale', 'ngFileUpload', 'LocalStorageModule' diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js index ff25fae3f5..7cc109a5c0 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js @@ -151,7 +151,7 @@ controller: 'Umbraco.Editors.Users.ChangePasswordDirectiveController', scope: { isNew: "=?", - passwordValues: "=", + passwordValues: "=", config: "=" } }; @@ -164,4 +164,4 @@ angular.module('umbraco.directives').directive('changePassword', ChangePasswordDirective); -})(); \ No newline at end of file +})(); diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/validation/showvalidationonsubmit.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/validation/showvalidationonsubmit.directive.js new file mode 100644 index 0000000000..41823bb2fd --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/directives/validation/showvalidationonsubmit.directive.js @@ -0,0 +1,35 @@ +(function () { + "use strict"; + + function showValidationOnSubmit(serverValidationManager) { + return { + require: "ngMessages", + restrict: "A", + + link: function (scope, element, attr, ctrl) { + + element.hide(); + + var unsubscribe = []; + + unsubscribe.push(scope.$on("formSubmitting", function (ev, args) { + element.show(); + })); + + unsubscribe.push(scope.$on("formSubmitted", function (ev, args) { + element.hide(); + })); + + element.bind('$destroy', function () { + for (var u in unsubscribe) { + unsubscribe[u](); + } + }); + + } + }; + } + + angular.module('umbraco.directives.validation').directive("showValidationOnSubmit", showValidationOnSubmit); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/install.loader.js b/src/Umbraco.Web.UI.Client/src/install.loader.js index e6aa4c95c0..99be6db9f1 100644 --- a/src/Umbraco.Web.UI.Client/src/install.loader.js +++ b/src/Umbraco.Web.UI.Client/src/install.loader.js @@ -5,6 +5,7 @@ LazyLoad.js([ 'lib/angular-cookies/angular-cookies.js', 'lib/angular-touch/angular-touch.js', 'lib/angular-sanitize/angular-sanitize.js', + 'lib/angular-messages/angular-messages.js', 'lib/underscore/underscore-min.js', 'lib/angular-ui-sortable/sortable.js', 'js/installer.app.js', diff --git a/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html b/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html index 34c5db4d3c..ba0bf519c2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/users/change-password.html @@ -12,50 +12,53 @@