Elfinder如何自定义菜单

时间:2017-09-15 07:47:32

标签: javascript jquery elfinder

您好我正在使用elfinder,我想删除删除和空文件夹选项。我该如何删除它。这是我的代码。

<script>
        $(function() {
            $('#elfinder').elfinder({   // 1st Arg - options
                    cssAutoLoad : false,// Disable CSS auto loading
                    baseUrl : './',// Base URL to css/*, js/*
                    url : 'php/connector.minimal.php',// Connector URL
                    getFileCallback : function(file) {/* ... */},// Callback when a file is double-clicked
                    width: '100%',
                    height: $(window).height() - 20                                                            
                });
        });</script>

1 个答案:

答案 0 :(得分:0)

试试这段代码:

<script>
$(function() {
    $('#elfinder').elfinder(
    // 1st Arg - options
    {
        // Disable CSS auto loading
        cssAutoLoad: false,
        // Base URL to css/*, js/*
        baseUrl: './',
        // Connector URL
        url: 'php/connector.minimal.php',
        // Callback when a file is double-clicked
        getFileCallback: function(file) {
            // ...
        },
        uiOptions: {
            // toolbar configuration
            toolbar: [
                ['home', 'back', 'forward', 'up', 'reload'],
                ['mkdir', 'mkfile', 'upload'],
                ['open', 'download', 'getfile'],
                ['undo', 'redo'],
                ['copy', 'cut', 'paste'],
                ['duplicate', 'rename', 'edit', 'resize', 'chmod'],
                ['selectall', 'selectnone', 'selectinvert'],
                ['quicklook', 'info'],
                ['extract', 'archive'],
                ['search'],
                ['view', 'sort'],
                ['fullscreen']
            ]
        },
        contextmenu: {
            // navbarfolder menu
            navbar: ['open', 'download', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', '|', 'rename', '|', 'places', 'info', 'chmod', 'netunmount'],
            // current directory menu
            cwd: ['undo', 'redo', '|', 'back', 'up', 'reload', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', '|', 'view', 'sort', 'selectall', 'colwidth', '|', 'info', '|', 'fullscreen', '|'],
            // current directory file menu
            files: ['getfile', '|', 'open', 'download', 'opendir', 'quicklook', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'empty', '|', 'rename', 'edit', 'resize', '|', 'archive', 'extract', '|', 'selectall', 'selectinvert', '|', 'places', 'info', 'chmod', 'netunmount']
        },
        width: '100%',
        height: $(window).height() - 20
    });
});
</script>

您还可以从elFinder.options.js文件中自定义菜单。已经提到了client configuration中的所有内容... !!!