Skip to content
Snippets Groups Projects
Commit 37c9a940 authored by Benjamin Kott's avatar Benjamin Kott Committed by Benni Mack
Browse files

[FEATURE] Make context menu trigger configurable

The context menu JavaScript API was adapted to also support opening
the menu through the "contextmenu" event type (right click) only.
Configuration for the context menu was streamlined and now reflects
its purpose. The trigger can now be set to "click" or "contextmenu".

Before:
    class="t3js-contextmenutrigger"
    data-table="pages"
    data-uid="10"
    data-context="tree"

After:
    data-contextmenu-trigger="click"
    data-contextmenu-table="pages"
    data-contextmenu-uid="10"
    data-contextmenu-context="tree"

New options:
data-contextmenu-trigger:
    click:
        Opens the contextmenu click and contextmenu
    contextmenu:
        Opens the contextmenu only on contextmenu

Examples:

    <a href="#"
        data-contextmenu-trigger="click"
        data-contextmenu-table="pages"
        data-contextmenu-uid="10"
    >
    Click and Contextmenu
    </a>

    <a href="#"
        data-contextmenu-trigger="contextmenu"
        data-contextmenu-table="pages"
        data-contextmenu-uid="10"
    >
    Contextmenu only
    </a>

Legacy configuration with `.t3js-contextmenutrigger` is still
supported to avoid migration issues, but is now considered
deprecated and will be removed with TYPO3 v13.

Resolves: #99084
Releases: main

Change-Id: I1a8429b2964f0372b3162994f49f4c1141dffc86
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76595


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent c302fac6
Branches
Tags
Showing
with 269 additions and 55 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment