mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 02:10:24 +00:00
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
This commit is contained in:
17
frontend/src/components/context-menu/helpers.js
Normal file
17
frontend/src/components/context-menu/helpers.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
);
|
Reference in New Issue
Block a user