Skip to content

Commit

Permalink
fix: merge adding subs in initializeContent
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 29, 2020
1 parent b500d4f commit d869d39
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions lib/minimap-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,18 +489,30 @@ class MinimapElement {
this.createVisibleArea()
this.createControls()

this.subscriptions.add(this.subscribeTo(this, {
mousewheel: (e) => {
if (!this.standAlone && this.minimap.onMouseWheel) {
this.minimap.onMouseWheel(e)
}
}
}, { passive: true }))
this.subscriptions.add(

this.subscriptions.add(this.subscribeTo(this.getFrontCanvas(), {
mousedown: (e) => { this.canvasPressed(this.extractMouseEventData(e)) },
touchstart: (e) => { this.canvasPressed(this.extractTouchEventData(e)) }
}, { passive: true }))
this.subscribeTo(
this,
{
mousewheel: (e) => {
if (!this.standAlone && this.minimap.onMouseWheel) {
this.minimap.onMouseWheel(e)
}
}
},
{ passive: true }
),

this.subscribeTo(
this.getFrontCanvas(),
{
mousedown: (e) => { this.canvasPressed(this.extractMouseEventData(e)) },
touchstart: (e) => { this.canvasPressed(this.extractTouchEventData(e)) }
},
{ passive: true }
)

)
}

/**
Expand Down

0 comments on commit d869d39

Please sign in to comment.