Merge pull request #1453 from natural-law/hot-fix

Solve the DragonBones event listeners will be missed when armature is changed in JSB.
This commit is contained in:
Jare Guo
2017-01-20 16:54:40 +08:00
committed by GitHub
@@ -391,6 +391,13 @@ dragonBones.ArmatureDisplay = cc.Class({
if (listenersBefore) {
sgNode._bubblingListeners = listenersBefore; // using the listeners added before
if (CC_JSB && !sgNode.hasEventCallback()) {
// In JSB, should set event callback of the new sgNode
// to make the listeners work well.
sgNode.setEventCallback(function (eventObject) {
sgNode.emit(eventObject.type, eventObject);
});
}
}
self._initSgNode();