diff --git a/docs/api/api_overview.md b/docs/api/api_overview.md index db214e4..e305fbb 100644 --- a/docs/api/api_overview.md +++ b/docs/api/api_overview.md @@ -117,6 +117,7 @@ description: You can have an API overview of the DHTMLX JavaScript To Do List li | [](api/configs/drag_config.md) | @getshort(api/configs/drag_config.md) | | [](api/configs/id_config.md) | @getshort(api/configs/id_config.md) | | [](api/configs/locale_config.md) | @getshort(api/configs/locale_config.md) | +| [](api/configs/menu_config.md) | @getshort(api/configs/menu_config.md) | | [](api/configs/priorities_config.md) | @getshort(api/configs/priorities_config.md) | | [](api/configs/projects_config.md) | @getshort(api/configs/projects_config.md) | | [](api/configs/readonly_config.md) | @getshort(api/configs/readonly_config.md) | diff --git a/docs/api/configs/menu_config.md b/docs/api/configs/menu_config.md new file mode 100644 index 0000000..a23452c --- /dev/null +++ b/docs/api/configs/menu_config.md @@ -0,0 +1,98 @@ +--- +sidebar_label: menu +title: menu Config +description: You can learn about the menu config in the documentation of the DHTMLX JavaScript To Do List library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX To Do List. +--- + +# menu + +### Description + +@short: Optional. Specifies the context menu visibility (if boolean) or configuration parameters (if function) + +### Usage + +~~~js +menu?: boolean; +// or +menu?: function(config: object); +~~~ + +#### Show or Hide Context Menu + +If you want to *hide* the context menu, set the `menu` config to `false`. To make the default context menu visible, set the `menu` config to `true`. + +~~~js +menu: true // display the default context menu + +// or + +menu: false // hide the context menu +~~~ + +#### Modify Context Menu + +If you want to *modify* a context menu, set the `menu` config to a callback that takes the `config` object as a parameter. The `config` object may have the following structure: + +~~~js +config: { + store: object, + type: "user" | "toolbar" | "task", + id?: string | number, + source?: (string | number)[] +}; +~~~ + +**Parameters** + +- `store` - (required) the readonly DataStore, that should be passed to the `getMenuOptions()` method +- `type` - (required) the type of the context menu. Here you can specify one of the following values: + - `"user"` - the context menu related to users + - `"toolbar"` - the context menu related to toolbar + - `"task"` - the context menu related to tasks +- `id` - (optional|required) the ID of the project. This parameter is required if `type: "toolbar"` +- `source` - (optional|required) an array that include the IDs of tasks. This parameter is required if `type: "toolbar"` + +**Returns** + +The callback should return one of the following values: + +- `boolean` - `true` to display a default context menu; `false` to hide context menu +- `null` - ? +- `object[]` - the array of objects that store data for context menu items. Each object may have the following structure: + + ~~~js + { + id: string | number, + type?: string, + icon?: string, + label?: string, + hotkey?: string, + value?: Date, + data?: object[], + handler?: function + } + ~~~ + + - `id` - (required) the ID of the menu item + - `icon` - (optional) the icon for the menu item (by default taken from the **wxi** font) + - `label` - (optional) the text for the menu item + - `hotkey` - (optional) a hotkey for the action from this menu item + - `value` - (optional) the due date, valid for "datepicker" + - `data` - (optional) the array of objects that store subitems of the menu item + - `handler` - (option) the handler that allows you to perform an action for a custom menu item + - `type` - (optional) the menu item type. Here you can specify the following types: + - `"item"` - + - `"separator"` - + - `"datepicker"` - + - `"user"` - + - `"priority"` - + +### Example + +~~~js {} +... +~~~ + +**Related articles:** +... diff --git a/docs/api/overview/configs_overview.md b/docs/api/overview/configs_overview.md index 51400d4..295bcde 100644 --- a/docs/api/overview/configs_overview.md +++ b/docs/api/overview/configs_overview.md @@ -12,6 +12,7 @@ description: You can explore the API properties of To Do List in the documentati | [](../configs/drag_config.md) | @getshort(../configs/drag_config.md) | | [](../configs/id_config.md) | @getshort(../configs/id_config.md) | | [](../configs/locale_config.md) | @getshort(../configs/locale_config.md) | +| [](../configs/menu_config.md) | @getshort(../configs/menu_config.md) | | [](../configs/priorities_config.md) | @getshort(../configs/priorities_config.md) | | [](../configs/projects_config.md) | @getshort(../configs/projects_config.md) | | [](../configs/readonly_config.md) | @getshort(../configs/readonly_config.md) | diff --git a/docs/whats_new.md b/docs/whats_new.md index 760523a..e4de29d 100644 --- a/docs/whats_new.md +++ b/docs/whats_new.md @@ -8,6 +8,14 @@ description: You can learn a new information about DHTMLX JavaScript To Do List If you are updating To Do List from an older version, check [Migration to newer version](migration.md) for details. +## Version 1.3 + +Released on February DAY, 2025 + +### Fixes + +- ... + ## Version 1.2.12 Released on November 15, 2024 diff --git a/sidebars.js b/sidebars.js index 656cefc..ad22c63 100644 --- a/sidebars.js +++ b/sidebars.js @@ -216,6 +216,7 @@ module.exports = { "api/configs/drag_config", "api/configs/id_config", "api/configs/locale_config", + "api/configs/menu_config", "api/configs/priorities_config", "api/configs/projects_config", "api/configs/readonly_config", diff --git a/src/css/custom.css b/src/css/custom.css index 4c812f8..98a2524 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -167,8 +167,8 @@ table { /* small code block */ code { - border-radius: 2px; - padding: 6px 8px; + border-radius: 5px; + padding: 2px 8px; font-weight: 600; }