mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
identified a couple public methods in the global object which are actually private
This commit is contained in:
12
dist/kinetic-core.js
vendored
12
dist/kinetic-core.js
vendored
@@ -67,11 +67,11 @@ Kinetic.GlobalObject = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addAnimation: function(anim) {
|
_addAnimation: function(anim) {
|
||||||
anim.id = Kinetic.GlobalObject.animIdCounter++;
|
anim.id = Kinetic.GlobalObject.animIdCounter++;
|
||||||
this.animations.push(anim);
|
this.animations.push(anim);
|
||||||
},
|
},
|
||||||
removeAnimation: function(id) {
|
_removeAnimation: function(id) {
|
||||||
var animations = this.animations;
|
var animations = this.animations;
|
||||||
for(var n = 0; n < animations.length; n++) {
|
for(var n = 0; n < animations.length; n++) {
|
||||||
if(animations[n].id === id) {
|
if(animations[n].id === id) {
|
||||||
@@ -831,11 +831,11 @@ Kinetic.Node.prototype = {
|
|||||||
* adding the animation with the addAnimation
|
* adding the animation with the addAnimation
|
||||||
* method auto generates an id
|
* method auto generates an id
|
||||||
*/
|
*/
|
||||||
go.addAnimation(anim);
|
go._addAnimation(anim);
|
||||||
|
|
||||||
// subscribe to onFinished for first tween
|
// subscribe to onFinished for first tween
|
||||||
trans.tweens[0].onFinished = function() {
|
trans.tweens[0].onFinished = function() {
|
||||||
go.removeAnimation(anim.id);
|
go._removeAnimation(anim.id);
|
||||||
if(config.callback !== undefined) {
|
if(config.callback !== undefined) {
|
||||||
config.callback();
|
config.callback();
|
||||||
}
|
}
|
||||||
@@ -1288,7 +1288,7 @@ Kinetic.Stage.prototype = {
|
|||||||
*/
|
*/
|
||||||
start: function() {
|
start: function() {
|
||||||
var go = Kinetic.GlobalObject;
|
var go = Kinetic.GlobalObject;
|
||||||
go.addAnimation(this.anim);
|
go._addAnimation(this.anim);
|
||||||
go._handleAnimation();
|
go._handleAnimation();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -1296,7 +1296,7 @@ Kinetic.Stage.prototype = {
|
|||||||
*/
|
*/
|
||||||
stop: function() {
|
stop: function() {
|
||||||
var go = Kinetic.GlobalObject;
|
var go = Kinetic.GlobalObject;
|
||||||
go.removeAnimation(this.anim.id);
|
go._removeAnimation(this.anim.id);
|
||||||
go._handleAnimation();
|
go._handleAnimation();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -39,11 +39,11 @@ Kinetic.GlobalObject = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addAnimation: function(anim) {
|
_addAnimation: function(anim) {
|
||||||
anim.id = Kinetic.GlobalObject.animIdCounter++;
|
anim.id = Kinetic.GlobalObject.animIdCounter++;
|
||||||
this.animations.push(anim);
|
this.animations.push(anim);
|
||||||
},
|
},
|
||||||
removeAnimation: function(id) {
|
_removeAnimation: function(id) {
|
||||||
var animations = this.animations;
|
var animations = this.animations;
|
||||||
for(var n = 0; n < animations.length; n++) {
|
for(var n = 0; n < animations.length; n++) {
|
||||||
if(animations[n].id === id) {
|
if(animations[n].id === id) {
|
||||||
|
|||||||
@@ -661,11 +661,11 @@ Kinetic.Node.prototype = {
|
|||||||
* adding the animation with the addAnimation
|
* adding the animation with the addAnimation
|
||||||
* method auto generates an id
|
* method auto generates an id
|
||||||
*/
|
*/
|
||||||
go.addAnimation(anim);
|
go._addAnimation(anim);
|
||||||
|
|
||||||
// subscribe to onFinished for first tween
|
// subscribe to onFinished for first tween
|
||||||
trans.tweens[0].onFinished = function() {
|
trans.tweens[0].onFinished = function() {
|
||||||
go.removeAnimation(anim.id);
|
go._removeAnimation(anim.id);
|
||||||
if(config.callback !== undefined) {
|
if(config.callback !== undefined) {
|
||||||
config.callback();
|
config.callback();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ Kinetic.Stage.prototype = {
|
|||||||
*/
|
*/
|
||||||
start: function() {
|
start: function() {
|
||||||
var go = Kinetic.GlobalObject;
|
var go = Kinetic.GlobalObject;
|
||||||
go.addAnimation(this.anim);
|
go._addAnimation(this.anim);
|
||||||
go._handleAnimation();
|
go._handleAnimation();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -94,7 +94,7 @@ Kinetic.Stage.prototype = {
|
|||||||
*/
|
*/
|
||||||
stop: function() {
|
stop: function() {
|
||||||
var go = Kinetic.GlobalObject;
|
var go = Kinetic.GlobalObject;
|
||||||
go.removeAnimation(this.anim.id);
|
go._removeAnimation(this.anim.id);
|
||||||
go._handleAnimation();
|
go._handleAnimation();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user