Fixes more of the umbcontentname directive - but we still have no design to show a validation message
This commit is contained in:
@@ -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...";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,14 +5,15 @@
|
||||
<h1 ng-click="goEdit()" ng-hide="editMode">{{model}}</h1>
|
||||
|
||||
<input
|
||||
class="input-xlarge"
|
||||
on-blur="exitEdit()"
|
||||
ng-show="editMode"
|
||||
name="name"
|
||||
type="text"
|
||||
placeholder="{{placeholder}}"
|
||||
ng-model="model"
|
||||
required
|
||||
val-server-field="Name" />
|
||||
required
|
||||
val-server-field="Name" />
|
||||
|
||||
<span class="help-inline" val-msg-for="name" val-toggle-msg="required">Required</span>
|
||||
<span class="help-inline" val-msg-for="name" val-toggle-msg="valServerField">{{contentNameForm.name.errorMsg}}</span>
|
||||
|
||||
Reference in New Issue
Block a user