;
(function () {
    'use strict';
    const
        apiService = require('app-service'),
        EventEmitter = require('myevents');
    angular
        .module('app.widgets')
        .directive('shareItem', shareItem);
        
    shareItem.$inject = ['$timeout', 'fileTool', '$mdDialog'];
    function shareItem($timeout, fileTool, $mdDialog) {
        var directive = {
            link: link,
            templateUrl: './app/widgets/share_item/table.list.html',
            restrict: 'EA',
            replace: true,
            scope: {
                files: '=',
                onClick: '='
            }
        };

        return directive;
        function link(scope, element, attrs) {
            let vm = scope;
            scope.$watch('files', function () {
                $('.chk-all').hasClass('active') ? $('.chk-all').click() : $('.tr-file').removeClass('active');
            });
        }
    }


})();
