Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Extending the [ ] menu

Olivier Paroz edited this page Mar 27, 2016 · 1 revision
var myFileMenuPlugin = {
    attach: function (menu) {
        menu.addMenuEntry({
            id: 'abc',
            displayName: 'Menu display name',
            iconClass: 'icon-filetype-text',
            actionHandler: function () {
                console.log('do something here');
            }
        });
    }
};
OC.Plugins.register('OCA.Gallery.NewFileMenu', myFileMenuPlugin);

This will register a new menu entry in the [+] menu of the gallery app. The method attach() is called once the menu is built. This usually happens right after the click on the button.

See the official documentation for more information