Skip to content

Commit

Permalink
version 2.0.0 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
patorjk committed Jan 5, 2021
1 parent 58aecaf commit e7c9ab0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,10 @@ The following example shows how to add a right click menu to a tree diagram:

http://plnkr.co/edit/bDBe0xGX1mCLzqYGOqOS?p=info

### What's new in version 1.1.3
### What's new in version 2.0.0
* Added support for D3 6.x
* The `index` parameter of callbacks are undefined when using D3 6.x or above. See the index.htm file in the example folder to see how to get the proper `index` value in that case.
* Added class property for menu items that allows specifying CSS classes (see: https://github.com/patorjk/d3-context-menu/pull/56).

### What's new in version 1.1.2
* Menu updated so it wont go off bottom or right of screen when window is smaller.
Expand Down
4 changes: 2 additions & 2 deletions js/d3-context-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@
var isDisabled = !!resolve(d.disabled);
var hasChildren = !!resolve(d.children);
var hasAction = !!d.action;
var hasCls = !!d.class;
var hasCls = !!d.className;
var text = isDivider ? '<hr>' : resolve(d.title);

var listItem = d3.select(this)
.classed('is-divider', isDivider)
.classed('is-disabled', isDisabled)
.classed('is-header', !hasChildren && !hasAction)
.classed('is-parent', hasChildren)
.classed(resolve(d.class),hasCls)
.classed(resolve(d.className),hasCls)
.html(text)
.on('click', function () {
// do nothing if disabled or no action
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d3-context-menu",
"version": "1.1.2",
"version": "2.0.0",
"description": "A plugin for d3.js that allows you to easily use context menus in your visualizations.",
"main": "js/d3-context-menu.js",
"directories": {
Expand Down

0 comments on commit e7c9ab0

Please sign in to comment.