mirror of
https://github.com/konvajs/konva.git
synced 2025-12-21 19:27:08 +08:00
changed listen property to listening, listen() to setListening(), and isListening() to getListening() for consistency
This commit is contained in:
34
src/Node.js
34
src/Node.js
@@ -11,7 +11,7 @@
|
||||
Kinetic.Node = function(config) {
|
||||
this.defaultNodeAttrs = {
|
||||
visible: true,
|
||||
listen: true,
|
||||
listening: true,
|
||||
name: undefined,
|
||||
alpha: 1,
|
||||
x: 0,
|
||||
@@ -475,21 +475,6 @@ Kinetic.Node.prototype = {
|
||||
rotation: this.getRotation() + (deg * Math.PI / 180)
|
||||
});
|
||||
},
|
||||
/**
|
||||
* listen or don't listen to events
|
||||
* @param {Boolean} listen
|
||||
*/
|
||||
listen: function(listen) {
|
||||
this.setAttrs({
|
||||
listen: listen
|
||||
});
|
||||
},
|
||||
/**
|
||||
* is listening or not
|
||||
*/
|
||||
isListening: function() {
|
||||
return this.attrs.listen;
|
||||
},
|
||||
/**
|
||||
* move node to top
|
||||
*/
|
||||
@@ -816,8 +801,8 @@ Kinetic.Node.prototype = {
|
||||
};
|
||||
|
||||
// add setters and getters
|
||||
Kinetic.GlobalObject.addSetters(Kinetic.Node, ['x', 'y', 'detectionType', 'rotation', 'alpha', 'name', 'id', 'draggable', 'dragConstraint', 'dragBounds']);
|
||||
Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType', 'rotation', 'alpha', 'name', 'id', 'draggable', 'offset', 'dragConstraint', 'dragBounds']);
|
||||
Kinetic.GlobalObject.addSetters(Kinetic.Node, ['x', 'y', 'detectionType', 'rotation', 'alpha', 'name', 'id', 'draggable', 'dragConstraint', 'dragBounds', 'listening']);
|
||||
Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType', 'rotation', 'alpha', 'name', 'id', 'draggable', 'offset', 'dragConstraint', 'dragBounds', 'listening']);
|
||||
|
||||
/**
|
||||
* set node x position
|
||||
@@ -881,6 +866,13 @@ Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType
|
||||
* @config {Number} [bottom] bottom bounds position
|
||||
*/
|
||||
|
||||
/**
|
||||
* listen or don't listen to events
|
||||
* @name setListening
|
||||
* @methodOf Kinetic.Node.prototype
|
||||
* @param {Boolean} listening
|
||||
*/
|
||||
|
||||
/**
|
||||
* get scale
|
||||
* @name getScale
|
||||
@@ -953,4 +945,10 @@ Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType
|
||||
* get drag bounds
|
||||
* @name getDragBounds
|
||||
* @methodOf Kinetic.Node.prototype
|
||||
*/
|
||||
|
||||
/**
|
||||
* determine if listening to events or not
|
||||
* @name getListening
|
||||
* @methodOf Kinetic.Node.prototype
|
||||
*/
|
||||
Reference in New Issue
Block a user