umb-locked-field: auto focus field when unlocked
This commit is contained in:
@@ -33,9 +33,25 @@ angular.module("umbraco.directives")
|
||||
}
|
||||
|
||||
scope.toggleLock = function(){
|
||||
|
||||
scope.locked = !scope.locked;
|
||||
|
||||
if(scope.locked === false) {
|
||||
autoFocusField();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function autoFocusField() {
|
||||
|
||||
// timeout to make sure dom has updated from a disabled field
|
||||
$timeout(function() {
|
||||
var input = element.children('.umb-locked-field__input');
|
||||
input.focus();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user