mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
reuse _onTouchCancel logic
This commit is contained in:
@@ -416,10 +416,6 @@ var Button = cc.Class({
|
||||
event.stopPropagation();
|
||||
},
|
||||
|
||||
_cancelButtonClick: function(){
|
||||
this._pressed = false;
|
||||
},
|
||||
|
||||
_onTouchCancel: function () {
|
||||
if (!this.interactable || !this.enabledInHierarchy) return;
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user