Skip to content
Snippets Groups Projects
Verified Commit dad0d48d authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: add event to tree-menu action, selected

parent 29690c9e
No related branches found
No related tags found
No related merge requests found
...@@ -126,6 +126,14 @@ class TreeMenu extends CustomElement { ...@@ -126,6 +126,14 @@ class TreeMenu extends CustomElement {
* @property {String} mapping.idTemplate template with the id placeholders in the form ${name}, where name is the key * @property {String} mapping.idTemplate template with the id placeholders in the form ${name}, where name is the key
* @property {String} mapping.parentKey the parent key * @property {String} mapping.parentKey the parent key
* @property {String} mapping.selection the selection * @property {String} mapping.selection the selection
* @property {Function} mapping.filter a filter function to filter the entries
* @property {Object} classes
* @property {String} classes.control the class for the control element
* @property {String} classes.label the class for the label element
* @property {Object} actions
* @property {Function} actions.open the action to open an entry (arguments, etnry, index, event)
* @property {Function} actions.close the action to close an entry (arguments, etnry, index, event)
* @property {Function} actions.select the action to select an entry (arguments, etnry, index, event)
*/ */
get defaults() { get defaults() {
return Object.assign({}, super.defaults, { return Object.assign({}, super.defaults, {
...@@ -157,7 +165,7 @@ class TreeMenu extends CustomElement { ...@@ -157,7 +165,7 @@ class TreeMenu extends CustomElement {
open: null, open: null,
close: null, close: null,
select: (entry) => { select: (entry) => {
throw new Error("no action defined for select"); console.warn("select action is not defined", entry);
}, },
}, },
...@@ -361,7 +369,7 @@ function initEventHandler() { ...@@ -361,7 +369,7 @@ function initEventHandler() {
container.classList.add("selected"); container.classList.add("selected");
if (isFunction(doAction)) { if (isFunction(doAction)) {
doAction.call(this, currentEntry, index); doAction.call(this, currentEntry, index, event);
} }
return; return;
} }
......
...@@ -156,7 +156,7 @@ function getMonsterVersion() { ...@@ -156,7 +156,7 @@ function getMonsterVersion() {
} }
/** don't touch, replaced by make with package.json version */ /** don't touch, replaced by make with package.json version */
monsterVersion = new Version("4.37.2"); monsterVersion = new Version("4.38.0");
return monsterVersion; return monsterVersion;
} }
...@@ -7,7 +7,7 @@ describe('Monster', function () { ...@@ -7,7 +7,7 @@ describe('Monster', function () {
let monsterVersion let monsterVersion
/** don´t touch, replaced by make with package.json version */ /** don´t touch, replaced by make with package.json version */
monsterVersion = new Version("4.37.2") monsterVersion = new Version("4.38.0")
let m = getMonsterVersion(); let m = getMonsterVersion();
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
</head> </head>
<body> <body>
<div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;"> <div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
<h1 style='margin-bottom: 0.1em;'>Monster 4.37.2</h1> <h1 style='margin-bottom: 0.1em;'>Monster 4.38.0</h1>
<div id="lastupdate" style='font-size:0.7em'>last update Mo 21. Jul 18:16:57 CEST 2025</div> <div id="lastupdate" style='font-size:0.7em'>last update Mi 23. Jul 15:15:52 CEST 2025</div>
</div> </div>
<div id="mocha-errors" <div id="mocha-errors"
style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div> style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment