This commit is contained in:
Лаврёнов Антон
2014-05-02 08:46:34 +08:00
parent 3aebe80404
commit 47e9533f0e
2 changed files with 9 additions and 9 deletions

View File

@@ -4,7 +4,7 @@
* http://www.kineticjs.com/ * http://www.kineticjs.com/
* Copyright 2013, Eric Rowell * Copyright 2013, Eric Rowell
* Licensed under the MIT or GPL Version 2 licenses. * Licensed under the MIT or GPL Version 2 licenses.
* Date: 2014-05-01 * Date: 2014-05-02
* *
* Copyright (C) 2011 - 2013 by Eric Rowell * Copyright (C) 2011 - 2013 by Eric Rowell
* *
@@ -3745,18 +3745,18 @@ var Kinetic = {};
evt.target = this; evt.target = this;
} }
if(eventType === MOUSEENTER && compareShape && this._id === compareShape._id) { if(eventType === MOUSEENTER && compareShape && (this._id === compareShape._id || (this.isAncestorOf && this.isAncestorOf(compareShape)))) {
okayToRun = false; okayToRun = false;
} }
else if(eventType === MOUSELEAVE && compareShape && this._id === compareShape._id) { else if(eventType === MOUSELEAVE && compareShape && (this._id === compareShape._id || (this.isAncestorOf && this.isAncestorOf(compareShape)))) {
okayToRun = false; okayToRun = false;
} }
if(okayToRun) { if(okayToRun) {
this._fire(eventType, evt); this._fire(eventType, evt);
// simulate event bubbling // simulate event bubbling
if(evt && !evt.cancelBubble && this.parent) { var stopBubble = (eventType === MOUSEENTER || eventType === MOUSELEAVE) && ((compareShape && compareShape.isAncestorOf && compareShape.isAncestorOf(this)) || !!(compareShape && compareShape.isAncestorOf));
if(evt && !evt.cancelBubble && this.parent && (!stopBubble)) {
if(compareShape && compareShape.parent) { if(compareShape && compareShape.parent) {
this._fireAndBubble.call(this.parent, eventType, evt, compareShape.parent); this._fireAndBubble.call(this.parent, eventType, evt, compareShape.parent);
} }

8
kinetic.min.js vendored

File diff suppressed because one or more lines are too long