Commit 188a206d authored by Sven Franck's avatar Sven Franck

bugfix currentTarget as fallback for events triggered on nested elements

parent 266ff545
...@@ -3830,7 +3830,7 @@ ...@@ -3830,7 +3830,7 @@
"className": "ui-btn " + (icon === null ? "" : "className": "ui-btn " + (icon === null ? "" :
"ui-btn-icon-right ui-icon-" + (icon === undefined ? "ui-btn-icon-right ui-icon-" + (icon === undefined ?
"carat-r" : icon)), "carat-r" : icon)),
"href": props.href "href": props.href;
}, },
{ {
"title": props.title || "", "title": props.title || "",
...@@ -6131,7 +6131,7 @@ ...@@ -6131,7 +6131,7 @@
*/ */
// TODO: clean this up // TODO: clean this up
app.action = function (e) { app.action = function (e) {
var type, tag, val, action, handler; var type, tag, val, action, handler, fallback;
type = e.type; type = e.type;
tag = e.target.tagName; tag = e.target.tagName;
...@@ -6153,9 +6153,10 @@ ...@@ -6153,9 +6153,10 @@
} }
// map // map
action = e.target.getAttribute("data-action"); action = e.target.getAttribute("data-action");
fallback = e.currentTarget.getAttribute("data-action");
handler = map.actions[action]; handler = map.actions[action];
if (action) { if (fallback || action) {
if (handler) { if (handler) {
handler(app.generateActionObject(e), val); handler(app.generateActionObject(e), val);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment