implemented dropdowns

This commit is contained in:
Fran Jurmanović
2021-06-06 14:25:58 +02:00
parent 2b0fcf4878
commit 53ee8dfd73
10 changed files with 246 additions and 20 deletions

View 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 () => {};
}

View File

@@ -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";