From f7c49758e1fe6f43feecd4ea6030d7985e1aaf90 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 9 Oct 2013 19:42:41 +1100 Subject: [PATCH] Fixes more of the umbcontentname directive - but we still have no design to show a validation message --- .../common/directives/editors/umbcontentname.directive.js | 7 +++++-- .../src/views/directives/umb-content-name.html | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbcontentname.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbcontentname.directive.js index 5ccfeb047b..59b8eb65d1 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbcontentname.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/editors/umbcontentname.directive.js @@ -21,7 +21,7 @@ angular.module("umbraco.directives") ngModel.$render = function(){ $timeout(function(){ - if(scope.model === ""){ + if(!scope.model){ scope.goEdit(); } }, 100); @@ -37,7 +37,10 @@ angular.module("umbraco.directives") scope.exitEdit = function(){ scope.editMode = false; - if(scope.model === ""){ + if (!scope.model) { + //TODO: This will not solve the problem of showing validation! + // if this is a duplicate name the server will return a server side valiation + // message - and we still have no place for this to display. scope.model = "Empty..."; } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/directives/umb-content-name.html b/src/Umbraco.Web.UI.Client/src/views/directives/umb-content-name.html index ccc96a99c3..472733be27 100644 --- a/src/Umbraco.Web.UI.Client/src/views/directives/umb-content-name.html +++ b/src/Umbraco.Web.UI.Client/src/views/directives/umb-content-name.html @@ -5,14 +5,15 @@

{{model}}

+ required + val-server-field="Name" /> Required {{contentNameForm.name.errorMsg}}