Skip to content

Commit

Permalink
refine code
Browse files Browse the repository at this point in the history
  • Loading branch information
cocos authored and cocos committed Sep 5, 2024
1 parent 7118f91 commit 116f900
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions editor/inspector/contributions/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1160,8 +1160,8 @@ const Elements = {
event.stopPropagation();
});

Elements.node.i18nChangeBind = Elements.node.i18nChange.bind(panel);
Editor.Message.addBroadcastListener('i18n:change', Elements.node.i18nChangeBind);
panel.i18nChangeBind = Elements.node.i18nChange.bind(panel);
Editor.Message.addBroadcastListener('i18n:change', panel.i18nChangeBind);
},
async update() {
const panel = this;
Expand Down Expand Up @@ -1404,7 +1404,9 @@ const Elements = {
}
},
close() {
Editor.Message.removeBroadcastListener('i18n:change', Elements.node.i18nChangeBind);
const panel = this;

Editor.Message.removeBroadcastListener('i18n:change', panel.i18nChangeBind);
},
i18nChange() {
const panel = this;
Expand Down

0 comments on commit 116f900

Please sign in to comment.