diff --git a/src/Container.js b/src/Container.js index ebb75742..87eeed7a 100644 --- a/src/Container.js +++ b/src/Container.js @@ -310,24 +310,6 @@ return this; } - /* - _isListeningEnabled: function() { - var ret; - - if (this._listeningEnabled) { - return true; - } - else { - ret = false; - this.children.each(function(child) { - if (child.isListeningEnabled()) { - ret = true; - } - }); - return ret; - } - } - */ }); Kinetic.Util.extend(Kinetic.Container, Kinetic.Node); diff --git a/src/Global.js b/src/Global.js index c1d9b077..2645e873 100644 --- a/src/Global.js +++ b/src/Global.js @@ -48,7 +48,6 @@ var Kinetic = {}; traceArrMax: 100, dblClickWindow: 400, pixelRatio: undefined, - enableHitGraph: true, // user agent UA: (function() { diff --git a/src/Node.js b/src/Node.js index c7d79579..daea9889 100644 --- a/src/Node.js +++ b/src/Node.js @@ -43,7 +43,6 @@ this.attrs = {}; this.cache = {}; this.setAttrs(config); - //this._listeningEnabled = false; // event bindings for cache handling this.on(TRANSFORM_CHANGE_STR, function() { @@ -418,13 +417,8 @@ * @memberof Kinetic.Node.prototype * @returns {Boolean} */ - /* - isListeningEnabled: function() { - return this._getCache(LISTENING_ENABLED, this._isListeningEnabled); - }, - */ shouldDrawHit: function() { - return Kinetic.enableHitGraph && /*this.isListeningEnabled() &&*/ this.isListening() && this.isVisible() && !Kinetic.isDragging(); + return this.isListening() && this.isVisible() && !Kinetic.isDragging(); }, /** * determine if node is visible or not. Node is visible only diff --git a/src/Shape.js b/src/Shape.js index 0a7b2732..7253ceb4 100644 --- a/src/Shape.js +++ b/src/Shape.js @@ -296,11 +296,6 @@ this.setDrawHitFunc(this.drawHitFunc); } } - /* - _isListeningEnabled: function() { - return this._listeningEnabled; - }, - */ }); Kinetic.Util.extend(Kinetic.Shape, Kinetic.Node); diff --git a/test/unit/Node-test.js b/test/unit/Node-test.js index dda0cf06..3fa6eb12 100644 --- a/test/unit/Node-test.js +++ b/test/unit/Node-test.js @@ -2620,7 +2620,7 @@ suite('Node', function() { }); // ====================================================== - test('Kinetic.enableHitGraph, listening, & shouldDrawHit', function(){ + test('listening, & shouldDrawHit', function(){ var stage = addStage(); var layer = new Kinetic.Layer(); @@ -2638,20 +2638,16 @@ suite('Node', function() { stage.add(layer); - // test enableHitGraph default - assert.equal(Kinetic.enableHitGraph, true); assert.equal(rect.isListening(), true); assert.equal(rect.shouldDrawHit(), true); - // disable hit graph - Kinetic.enableHitGraph = false; + rect.setListening(false); - assert.equal(rect.isListening(), true); + + assert.equal(rect.isListening(), false); assert.equal(rect.shouldDrawHit(), false); - // set the flag back for future tests - Kinetic.enableHitGraph = true; }); }); \ No newline at end of file