reuse _onTouchCancel logic

This commit is contained in:
zilongshanren
2016-06-24 14:59:17 +08:00
parent a6ebe3ce5f
commit 7d2a9985e4
2 changed files with 1 additions and 5 deletions
-4
View File
@@ -416,10 +416,6 @@ var Button = cc.Class({
event.stopPropagation();
},
_cancelButtonClick: function(){
this._pressed = false;
},
_onTouchCancel: function () {
if (!this.interactable || !this.enabledInHierarchy) return;
+1 -1
View File
@@ -798,7 +798,7 @@ var ScrollView = cc.Class({
this._touchMoved = true;
var buttonComponent = event.target.getComponent(cc.Button);
if (buttonComponent) {
buttonComponent._cancelButtonClick();
buttonComponent._onTouchCancel();
}
}
// TODO: detect move distance, if distance greater than a seuil, then stop propagation.