We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47212
    • 40 Posts
    Hello,

    Is there a way to disable the right-click context menu in the resources tree ? It's something that I thought absolutely certain to exist, but I can't find anything about.

    Is this an inaccessible dream ?

    This question has been answered by romainfallet. See the first response.

    • Do you need to disable the entire menu, or just some of the items in it?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 47212
        • 40 Posts
        I need to disable the entire menu. In my opinion, the right click menu is definitely not appropriate for a web site. It's not user friendly for a lambda user.

        But if you know how to disable only some items (without removing the related access right), I will be happy to know.
          • 47212
          • 40 Posts
          After some researchs, I didn't find any way to disable this right-click menu. Even a "display: none" in the manager CSS is impossible. This menu does not have an id, a class or a DOM hierarchy that I can target precisely (I hate ExtJS for that). And I don't know neither if I can add an id or a class somewhere to perform this. But I will continue my research that way, I think CSS is my best option for now.
          • discuss.answer
            • 47212
            • 40 Posts
            Ah ah ! I finally found the solution. To disable completely the right-click menu of the resources tree, simply comment line 196 :
            this.on('contextmenu',this._showContextMenu,this);

            and line 201 :
            this.on('contextmenu',this._saveState,this);

            in manager/assets/modext/widgets/core/tree/modx.tree.js file.

            The right-click menu will never show up with that.