3.0.0-beta.1
Pre-release
Pre-release
Migrating
- To migrate, you only need to change all callback functions to the new arguments (
icon,build,visible,disabled, itemcallbackand global itemcallback). Also if you listen tocontextmenuevents, please check if you still get the correct data.
Changed
- Restructured the code to use Webpack with Babel. Build the code with
yarn run webpack. - Changed linting to ESLint.
- Moved to BrowserStack for browser testing.
- Added JSDoc for generated API documentation.
- Added 3.x documentation on GitHub pages.
- The previous
optandrootarguments are now described ascurrentMenuDataandrootMenuData, which are documented in ContextMenuData. - Defined a few callback types to illustrate the arguments with which they are called.
- Build callback ContextMenuBuildCallback is now
function(e, $currentTrigger). - Icon callback ContextMenuIconCallback is now
function(e, $item, key, item, currentMenuData, rootMenuData). - The visibile, disabled, global callback and item callback ContextMenuItemCallback is now
function(e, key, currentMenuData, rootMenuData). - If you define custom menu item types in
$.contextMenu.typesthey get called as ContextMenuItemTypeCallback withfunction(e, item, currentMenuData, rootMenuData). - All events should always include event data containing the ContextMenuData as described in ContextMenuEvent. So if you listen to
contextmenuevents you should always have the data available.
Fixed
- Add options argument to events.activates. (Issue #580)
- Fix support for
$(element).contextMenu('update')which was broken. - Fixed bug in checking visibility of items for menu visibility. If a menu item was defined as
{ item: { visible: false } }it would not stop the menu from showing.