mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 06:08:10 +00:00
implemented dropdowns
This commit is contained in:
18
src/core/utils/find-method.ts
Normal file
18
src/core/utils/find-method.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { AppMainElement } from "components/";
|
||||
|
||||
export default function findMethod(
|
||||
actionString: string,
|
||||
appMain: AppMainElement
|
||||
): Function {
|
||||
if (actionString) {
|
||||
const methodSep = actionString.lastIndexOf("#");
|
||||
const tag = actionString.slice(0, methodSep);
|
||||
const method = actionString.slice(methodSep + 1);
|
||||
|
||||
const element = appMain.querySelector(tag);
|
||||
if (element) {
|
||||
return element?.[method];
|
||||
}
|
||||
}
|
||||
return () => {};
|
||||
}
|
||||
@@ -6,3 +6,4 @@ export { default as isTrue } from "./isTrue";
|
||||
export { default as firstUpper } from "./first-upper";
|
||||
export { default as query } from "./query-deco";
|
||||
export { default as querys } from "./querys-deco";
|
||||
export { default as findMethod } from "./find-method";
|
||||
|
||||
Reference in New Issue
Block a user