Bug 1507870 - add support for contextmenu extensibility of TreeRow. r=Honza
authorYura Zenevich <yura.zenevich@gmail.com>
Fri, 30 Nov 2018 14:54:59 +0000
changeset 505419 7b2786f1874312c62136e47722ffa55911fe8a4f
parent 505418 67670eab469be12d0626017f0bfedd6967d04320
child 505420 aa273e2036815104cb170ec0acf522aa4788e8e2
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1507870
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507870 - add support for contextmenu extensibility of TreeRow. r=Honza MozReview-Commit-ID: HhoNsCAiZAk Differential Revision: https://phabricator.services.mozilla.com/D12501
devtools/client/shared/components/tree/TreeRow.js
--- a/devtools/client/shared/components/tree/TreeRow.js
+++ b/devtools/client/shared/components/tree/TreeRow.js
@@ -44,16 +44,17 @@ define(function(require, exports, module
         }),
         decorator: PropTypes.object,
         renderCell: PropTypes.object,
         renderLabelCell: PropTypes.object,
         columns: PropTypes.array.isRequired,
         id: PropTypes.string.isRequired,
         provider: PropTypes.object.isRequired,
         onClick: PropTypes.func.isRequired,
+        onContextMenu: PropTypes.func,
         onMouseOver: PropTypes.func,
         onMouseOut: PropTypes.func,
       };
     }
 
     constructor(props) {
       super(props);
       this.getRowClass = this.getRowClass.bind(this);
@@ -115,22 +116,24 @@ define(function(require, exports, module
       }
 
       return classNames;
     }
 
     render() {
       const member = this.props.member;
       const decorator = this.props.decorator;
+
       const props = {
         id: this.props.id,
         role: "treeitem",
         "aria-level": member.level,
         "aria-selected": !!member.selected,
         onClick: this.props.onClick,
+        onContextMenu: this.props.onContextMenu,
         onMouseOver: this.props.onMouseOver,
         onMouseOut: this.props.onMouseOut,
       };
 
       // Compute class name list for the <tr> element.
       const classNames = this.getRowClass(member.object) || [];
       classNames.push("treeRow");
       classNames.push(member.type + "Row");