Skip to content

Commit

Permalink
Merge pull request #124 from atom-community/fix-mouse-move
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Feb 27, 2021
2 parents f230f6b + 92fb28d commit 487e0fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"title": "Hover/Stay Time",
"description": "The time that the mouse/cursor should hover/stay to show a datatip. Also specifies the time that the datatip is still shown when the mouse/cursor moves [ms].",
"type": "number",
"default": 80
"default": 100
},
"glowOnHover": {
"title": "Glow on hover",
Expand Down
28 changes: 15 additions & 13 deletions lib/datatip-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,24 +487,26 @@ export class DataTipManager {
})
disposables.add(new Disposable(() => overlayMarker.destroy()))

element.addEventListener("mouseenter", () => {
this.editorView?.removeEventListener("mousemove", this.onMouseMoveEvt)
})
if (this.showDataTipOnMouseMove) {
element.addEventListener("mouseenter", () => {
this.editorView?.removeEventListener("mousemove", this.onMouseMoveEvt)
})

element.addEventListener("mouseleave", () => {
this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt)
})
element.addEventListener("mouseleave", () => {
this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt)
})

disposables.add(
new Disposable(() => {
this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt)
view.destroy()
})
)
}

// TODO move this code to atom-ide-base
element.addEventListener("wheel", this.onMouseWheel, { passive: true })

disposables.add(
new Disposable(() => {
this.editorView?.addEventListener("mousemove", this.onMouseMoveEvt)
view.destroy()
})
)

return disposables
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"test.integration": "npm run build && atom --test spec",
"clean": "shx rm -rf dist",
"tsc": "tsc -p ./lib/tsconfig.json",
"tsc.dev": "npm run tsc -- --watch",
"dev": "npm run clean && cross-env NODE_ENV=development cross-env BABEL_KEEP_MODULES=true rollup -c -w",
"build": "npm run clean && cross-env NODE_ENV=production cross-env BABEL_KEEP_MODULES=true rollup -c",
"build-commit": "build-commit -o dist",
Expand Down

0 comments on commit 487e0fb

Please sign in to comment.