umb-auto-focus: add attribute to allow focus on filled inputs

This commit is contained in:
Mads Rasmussen
2015-08-25 10:09:52 +02:00
parent 374c718d49
commit b6e87ae0d7

View File

@@ -4,7 +4,7 @@ angular.module("umbraco.directives")
return function(scope, element, attr){
var update = function() {
//if it uses its default naming
if(element.val() === ""){
if(element.val() === "" || attr.focusOnFilled){
element.focus();
}
};