mirror of https://github.com/nextcloud/contacts
Set focus on group field after adding
This commit is contained in:
parent
d9bdc42176
commit
62cc23d37d
|
@ -8,7 +8,11 @@ app.directive('focusExpression', function ($timeout) {
|
|||
if (attrs.focusExpression) {
|
||||
if (scope.$eval(attrs.focusExpression)) {
|
||||
$timeout(function () {
|
||||
element[0].focus();
|
||||
if (element.is('input')) {
|
||||
element.focus();
|
||||
} else {
|
||||
element.find('input').focus();
|
||||
}
|
||||
}, 100); //need some delay to work with ng-disabled
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,11 @@ app.directive('focusExpression', function ($timeout) {
|
|||
if (attrs.focusExpression) {
|
||||
if (scope.$eval(attrs.focusExpression)) {
|
||||
$timeout(function () {
|
||||
element[0].focus();
|
||||
if (element.is('input')) {
|
||||
element.focus();
|
||||
} else {
|
||||
element.find('input').focus();
|
||||
}
|
||||
}, 100); //need some delay to work with ng-disabled
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<label ng-if="ctrl.availableOptions.length === 0" for="details-{{ctrl.name}}">{{ctrl.meta.readableName}}</label>
|
||||
<ui-select id="details-{{ctrl.name}}" multiple tagging tagging-label="{{ctrl.t.newGroup}}" ng-model="ctrl.data.value" group-model
|
||||
on-remove="ctrl.model.updateContact()" on-select="ctrl.model.updateContact()"
|
||||
theme="select2">
|
||||
theme="select2" focus-expression="$parent.$parent.ctrl.focus === ctrl.name">
|
||||
<ui-select-match placeholder="{{ctrl.meta.readableName}}">{{$item}}</ui-select-match>
|
||||
<ui-select-choices repeat="group in ctrl.availableGroups | filter:$select.search">
|
||||
{{group}}
|
||||
|
|
Loading…
Reference in New Issue