[Pkg-javascript-commits] [dojo] 22/23: Fix #18254

David Prévot taffit at moszumanska.debian.org
Sun Sep 14 16:23:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.9.4
in repository dojo.

commit 2fc0590abf1035b7a4e2c23a68fa9be05f7a11a2
Author: Colin Snover <github.com at zetafleet.com>
Date:   Sat Sep 6 01:16:58 2014 +0000

    Fix #18254
    
    (cherry picked from commit e4296a68b2eee9420ea21beb5b3fb7c1f6e9a8f6)
---
 on.js          | 4 +++-
 tests/on/on.js | 9 +++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/on.js b/on.js
index d3a8311..ef71d9c 100644
--- a/on.js
+++ b/on.js
@@ -224,7 +224,9 @@ define(["./has!dom-addeventlistener?:./aspect", "./_base/kernel", "./sniff"], fu
 				// call select to see if we match
 				var eventTarget = select(event.target);
 				// if it matches we call the listener
-				return eventTarget && listener.call(eventTarget, event);
+				if (eventTarget) {
+					return listener.call(eventTarget, event);
+				}
 			});
 		};
 	};
diff --git a/tests/on/on.js b/tests/on/on.js
index bb5c031..2aae379 100644
--- a/tests/on/on.js
+++ b/tests/on/on.js
@@ -296,6 +296,15 @@ define([
 			});
 			button.click();
 			t.is(testValue, 3);
+		},
+		function delegatePreventDefault(t){
+			var div = document.createElement("div");
+			div.innerHTML = '<input type="checkbox">';
+			var cb = div.childNodes[0];
+			document.body.appendChild(div);
+			on(div, '.matchesNothing:click', function () {});
+			cb.click();
+			t.t(cb.checked);
 		}
 	]);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list