(function () {
    'use strict';

    angular
        .module('editorRotas')
        .directive('informacoesRota', informacoesRota);

    informacoesRota.$inject = ['__env'];

    function informacoesRota(__env) {
        let directive = {
            link: link,
            restrict: 'E',
            scope: false,
            replace: true,
            templateUrl: __env.appPath + 'scripts/components/ferramentas/informacoes-rota/informacoes-rota.html',
        };

        function link(scope, element, attrs) {
            angular.extend(scope.vm, {});

            if (scope.vm.permissions.indexOf('informacoesRota') === -1) element.addClass('disabled');

            element.find('.center-default-list').slimScroll({
                allowPageScroll: false,
                color: '#ababab',
                disableFadeOut: false,
                distance: "5px",
                height: '180px',
                size: "10px",
                alwaysVisible: true,
                wheelStep: 10
            });
        }

        return directive;
    }

})();
