Skip to content
This repository was archived by the owner on Aug 14, 2021. It is now read-only.
This repository was archived by the owner on Aug 14, 2021. It is now read-only.

make the setEntry API more intuitive #36

Closed
@tponthieux

Description

@tponthieux

The setEntry command should take parameter that looks more like the menu option literal. Right now the command requires a parameter to identify the menu option, and then an object that somewhat resembles the menu option.

$(...).contextmenu('setEntry', 'paste', {title: 'Paste link'});

Why not put the identifier in the menu option supplement? That way it would look more like the menu option literal provided in the menu array.

$(...).contextmenu('setEntry', {cmd: 'paste', title: 'Paste link'});

If the value for cmd doesn't match anything in the menu array, it could add a new menu option.

While we're at it, why call the menu option identifier cmd? The value of cmd isn't a command, it's a string ('paste'). It should be called something that reflects its purpose as a unique identifier. How about name or id?

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions