forked from vkbansal/react-contextmenu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.js
More file actions
29 lines (24 loc) · 904 Bytes
/
Copy pathhelpers.js
File metadata and controls
29 lines (24 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
export function callIfExists(func, ...args) {
return (typeof func === 'function') && func(...args);
}
export function hasOwnProp(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
export function uniqueId() {
return Math.random().toString(36).substring(7);
}
export const cssClasses = {
menu: 'react-contextmenu',
menuVisible: 'react-contextmenu--visible',
menuWrapper: 'react-contextmenu-wrapper',
menuItem: 'react-contextmenu-item',
menuItemActive: 'react-contextmenu-item--active',
menuItemDisabled: 'react-contextmenu-item--disabled',
menuItemDivider: 'react-contextmenu-item--divider',
menuItemSelected: 'react-contextmenu-item--selected',
subMenu: 'react-contextmenu-submenu'
};
export const store = {};
export const canUseDOM = Boolean(
typeof window !== 'undefined' && window.document && window.document.createElement
);