1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-11 20:01:40 +00:00
seahub/frontend/src/components/context-menu/helpers.js
杨顺强 5d2a2b238c Contextmenu improve (#3238)
* add a commen contextmenu component

* optimized translate for menu

* repair contextmenu bug

* optimized share btn show code

* repair showShareBtn bug

* optimized contextmenu

* optimized contextmenu code

* complete dirent-item-menu logic

* optimized contextmenu code

* complete dirent-container-menu logic

* complete tree-node-contextmenu logic

* delete unnecessary code

* optimized contextmenu func

* repair bug

* optimized code style

* optimized code style

* add a dirent-none-view for dir-list-view mode

* optimized dirent-container-menu&dirent-item-menu

* add select-item contextmenu

* repair rebase bug
2019-04-11 21:04:47 +08:00

18 lines
435 B
JavaScript

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 store = {};
export const canUseDOM = Boolean(
typeof window !== 'undefined' && window.document && window.document.createElement
);