<script type="text/javascript" nonce="{{ js_wk_nonce() }}">
    require(
        ['jquery', 'pim/tree/manage', 'bootstrap'],
        function($, TreeManage){
            'use strict';
            $(function() {
                var buttons = [];
                
                    buttons.push($('<a>', {
                        'class': 'no-hash',
                        'data-toggle': 'tooltip',
                        'data-placement': 'right',
                        'data-original-title': '{{ "btn.create.tree"|trans|capitalize }}'
                    }).html(
                        $('<i>', { 'class': 'icon-plus-sign' })
                    ).on('click', function () {
                        Backbone.history.navigate('#{{ path(route ~ '_categorytree_create') }}', { trigger: true });
                    }).tooltip());
                
                new TreeManage('#tree', '{{ route }}');
            });
        }
    );
</script>