UNPKG

azure-devops-ui

Version:

React components for building web UI in Azure DevOps

1 lines 712 B
import"../../CommonImports";import"../../Core/core.css";import"./Menu.css";import"./MenuButton.css";var ContextMenuBehavior=function(){function n(n,t){var o=this;void 0===t&&(t=!1),this.initialize=function(n,t,e){o.eventDispatch=e,o.eventDispatch.addEventListener("contextmenu",o.onContextMenu)},this.onContextMenu=function(n){if(o.allowDefaultMenuOnAnchor&&n.nativeEvent instanceof MouseEvent){var t=n.nativeEvent.target;if(t&&"A"===t.nodeName)return}o.contextMenuHandler(n)},this.contextMenuHandler=n,this.allowDefaultMenuOnAnchor=t}return n.prototype.componentWillUnmount=function(){var n;null!=(n=this.eventDispatch)&&n.removeEventListener("contextmenu",this.onContextMenu)},n}();export{ContextMenuBehavior};