superdesk/superdesk-client-core

View on GitHub
scripts/apps/authoring/attachments/AttachmentsEditorDirective.ts

Summary

Maintainability
A
0 mins
Test Coverage

export default function AttachmentsEditorDirective() {
    return {
        templateUrl: 'scripts/apps/authoring/attachments/attachments.html',
        link: function(scope, elem, attrs, controllers) {
            scope.attachmentsInAuthoring = true;

            if (attrs.readOnly != null) {
                scope.$watch(attrs.readOnly, (value) => {
                    // can't use bindings since creating an isolate scope would make some variables inaccessible
                    scope.readOnly = value;
                });
            }
        },
    };
}