Skip to content

Commit

Permalink
fix #437
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Aug 20, 2013
1 parent 6cb2842 commit eb411cf
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
10 changes: 5 additions & 5 deletions build/event/dom/base-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions build/event/dom/base.js
@@ -1,7 +1,7 @@
/*
Copyright 2013, KISSY UI Library v1.40dev
MIT Licensed
build time: Aug 14 23:59
build time: Aug 20 18:14
*/
/*
Combined processedModules by KISSY Module Compiler:
Expand Down Expand Up @@ -647,8 +647,7 @@ KISSY.add('event/dom/base/object', function (S, BaseEvent, undefined) {
* custom event for dom.
* @author yiminghe@gmail.com
*/
KISSY.add('event/dom/base/observable', function (S, Dom, Special, DomEventUtils,
DomEventObserver, DomEventObject, BaseEvent) {
KISSY.add('event/dom/base/observable', function (S, Dom, Special, DomEventUtils, DomEventObserver, DomEventObject, BaseEvent) {

// 记录手工 fire(domElement,type) 时的 type
// 再在浏览器通知的系统 eventHandler 中检查
Expand Down Expand Up @@ -731,7 +730,9 @@ KISSY.add('event/dom/base/observable', function (S, Dom, Special, DomEventUtils,
observer;

// collect delegated observers and corresponding element
if (delegateCount && target.nodeType) {
// https://github.com/kissyteam/kissy/issues/437
if (delegateCount && target.nodeType &&
(!event['button'] || eventType !== "click")) {
while (target != currentTarget) {
if (target.disabled !== true || eventType !== "click") {
var cachedMatch = {},
Expand Down
Expand Up @@ -3,8 +3,7 @@
* custom event for dom.
* @author yiminghe@gmail.com
*/
KISSY.add('event/dom/base/observable', function (S, Dom, Special, DomEventUtils,
DomEventObserver, DomEventObject, BaseEvent) {
KISSY.add('event/dom/base/observable', function (S, Dom, Special, DomEventUtils, DomEventObserver, DomEventObject, BaseEvent) {

// 记录手工 fire(domElement,type) 时的 type
// 再在浏览器通知的系统 eventHandler 中检查
Expand Down Expand Up @@ -87,7 +86,9 @@ KISSY.add('event/dom/base/observable', function (S, Dom, Special, DomEventUtils,
observer;

// collect delegated observers and corresponding element
if (delegateCount && target.nodeType) {
// https://github.com/kissyteam/kissy/issues/437
if (delegateCount && target.nodeType &&
(!event['button'] || eventType !== "click")) {
while (target != currentTarget) {
if (target.disabled !== true || eventType !== "click") {
var cachedMatch = {},
Expand Down
@@ -0,0 +1,16 @@
<div style="width: 100px;height: 100px;border: 1px solid red;" id="t">
<div
id="t2"
style="width: 40px;height:40px;margin: 20px;border: 1px solid green;"></div>
</div>
<script src="/kissy/build/seed.js"></script>
<script>
KISSY.use('node', function (S, Node) {
S.ready(function () {
var $ = Node.all;
$('#t').on('click', function (e) {
alert(e.target.id + ' : ' + e.button);
});
});
});
</script>

0 comments on commit eb411cf

Please sign in to comment.