Skip to content

Commit a69d0d9

Browse files
committed
Bind basic listeners only when props.event is null
1 parent 5654ea9 commit a69d0d9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/decorators/bodyMode.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ export default function (target) {
7373

7474
this.unbindBodyListener(body)
7575

76-
const listeners = this.bodyModeListeners = {
77-
'mouseover': bodyListener.bind(this, this.showTooltip, {}),
78-
'mousemove': bodyListener.bind(this, this.updateTooltip, { respectEffect: true }),
79-
'mouseout': bodyListener.bind(this, this.hideTooltip, {})
76+
const listeners = this.bodyModeListeners = {}
77+
if (event == null) {
78+
listeners.mouseover = bodyListener.bind(this, this.showTooltip, {})
79+
listeners.mousemove = bodyListener.bind(this, this.updateTooltip, { respectEffect: true })
80+
listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {})
8081
}
8182

8283
for (const event in customEvents) {

0 commit comments

Comments
 (0)