; (function () {
    'use strict';

    angular
        .module('app.widgets')
        .directive('topMenu', topMenu);
    topMenu.$injec = ["$scope"];
    function topMenu() {
        var directive = {
            controller: linkCtr,
            templateUrl: './app/widgets/top_widget/top_widgets.html',
            restrict: 'EA',
            replace: true,
            scope: {
                menuBtn: '=',
                disableUpload: '='
            }
        };
        linkCtr.$inject = ['$scope'];
        return directive;
        function linkCtr($scope, $mdMenu, $event) {
            var vm = $scope; 
            vm.openMenu = function ($mdMenu, ev) {
                $mdMenu.open(ev);
            };
            vm.uploadFile = () => {
                document.querySelector('#fileDialog').click();
            }
            vm.uploadFolder = () => {
                document.querySelector('#folderDialog').click();
            }
        }

    }
})();