[Pkg-javascript-commits] [dojo] 12/21: Fix #18254

David Prévot taffit at moszumanska.debian.org
Sun Sep 14 15:39:22 UTC 2014


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

taffit pushed a commit to branch master
in repository dojo.

commit 2bde291b153238d59514e45beb13f687b4301e0e
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 ef42cb6..59488cd 100644
--- a/on.js
+++ b/on.js
@@ -256,7 +256,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 fc3f618..29121c2 100644
--- a/tests/on/on.js
+++ b/tests/on/on.js
@@ -417,6 +417,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