mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-22 11:57:34 +00:00
refactor(metadata): remove ui-component (#7492)
1. ModalPortal 2. Icon 3. IconBtn 4. Loading 5. CenteredLoading 6. ClickOutside 7. SearchInput 8. Switch 9. CustomizeAddTool 10. SfCalendar 11. SfFilterCalendar 12. CustomizeSelect 13. CustomizePopover 14. FieldDisplaySettings 15. Formatters 16. remove duplicate codes
This commit is contained in:
@@ -1,23 +1,3 @@
|
||||
export const addClassName = (originClassName, targetClassName) => {
|
||||
const originClassNames = originClassName.split(' ');
|
||||
if (originClassNames.indexOf(targetClassName) > -1) return originClassName;
|
||||
return originClassName + ' ' + targetClassName;
|
||||
};
|
||||
|
||||
export const removeClassName = (originClassName, targetClassName) => {
|
||||
let originClassNames = originClassName.split(' ');
|
||||
const targetClassNameIndex = originClassNames.indexOf(targetClassName);
|
||||
if (targetClassNameIndex < 0) return originClassName;
|
||||
originClassNames.splice(targetClassNameIndex, 1);
|
||||
return originClassNames.join(' ');
|
||||
};
|
||||
|
||||
export const getEventClassName = (e) => {
|
||||
// svg mouseEvent event.target.className is an object
|
||||
if (!e || !e.target) return '';
|
||||
return e.target.getAttribute('class') || '';
|
||||
};
|
||||
|
||||
/* is weiXin built-in browser */
|
||||
export const isWeiXinBuiltInBrowser = () => {
|
||||
const agent = navigator.userAgent.toLowerCase();
|
||||
|
Reference in New Issue
Block a user