superdesk/superdesk-client-core

View on GitHub
scripts/apps/desks/directives/FocusElement.ts

Summary

Maintainability
A
0 mins
Test Coverage
import {defer} from 'lodash';

export function FocusElement() {
    return {
        link: function(scope, elem, attrs) {
            elem.click(() => {
                defer(() => {
                    angular.element(document.querySelector(attrs.target)).focus();
                });
            });
        },
    };
}