Skip to content

Commit 8fd9169

Browse files
authored
Merge pull request #61 from aminya/patch-1
Decrease waiting/hiding time
2 parents 55d9660 + cc87ca8 commit 8fd9169

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

lib/datatip-manager.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,23 @@ module.exports = class DatatipManager {
6767
*/
6868
this.onCursorMoveEvt = this.onCursorMoveEvt.bind(this);
6969
/**
70-
* to optimize show/hide calls we set a timeout of 500ms for the mouse movement
71-
* only if the mouse pointer is not moving for more than 500ms the data tip functionality is triggered
70+
* to optimize show/hide calls we set a timeout of hoverTime for the mouse movement
71+
* only if the mouse pointer is not moving for more than hoverTime the data tip functionality is triggered
7272
*/
7373
this.mouseMoveTimer = null;
7474
/**
75-
* to optimize show/hide calls we set a timeout of 500ms for the cursor movement
76-
* only if the cursor is not moving for more than 500ms the data tip functionality is triggered
75+
* to optimize show/hide calls we set a timeout of hoverTime for the cursor movement
76+
* only if the cursor is not moving for more than hoverTime the data tip functionality is triggered
7777
*/
7878
this.cursorMoveTimer = null;
7979
/**
8080
* a reference to the markdown rendering service
8181
* @type {AtomIDE.MarkdownService}
8282
*/
8383
this.renderer = null;
84+
85+
/** 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]. */
86+
this.hoverTime = atom.config.get("atom-ide-datatip.hoverTime");
8487
}
8588

8689
/**
@@ -233,7 +236,7 @@ module.exports = class DatatipManager {
233236
(!this.currentMarkerRange.containsPoint(position))) {
234237
this.showDataTip(editor, position, evt);
235238
}
236-
}, 500, evt);
239+
}, this.hoverTime, evt);
237240
}
238241

239242
/**
@@ -272,7 +275,7 @@ module.exports = class DatatipManager {
272275
(!this.currentMarkerRange.containsPoint(point))) {
273276
this.showDataTip(this.editor, point, evt);
274277
}
275-
}, 500, evt);
278+
}, this.hoverTime, evt);
276279
}
277280

278281
/**

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,22 @@
5555
},
5656
"configSchema": {
5757
"showDataTipOnCursorMove": {
58-
"title": "Flag denotes if the data tip should be shown automatically when the cursor moves",
59-
"description": "If set to true, the data tip is shown as soon as you move your cursor around. Otherwise you will have to activate it via keypress.",
58+
"title": "Show datatip automatically on \"cursor\" stay",
59+
"description": "If set to true, the data tip is shown as soon as you move your cursor stays on a word. Otherwise you will have to activate it via keypress.",
6060
"type": "boolean",
6161
"default": true
6262
},
6363
"showDataTipOnMouseMove": {
64-
"title": "Flag denotes if the data tip should be shown automatically when the mouse moves",
65-
"description": "If set to true, the data tip is shown as soon as you move your mouse around.",
64+
"title": "Show datatip automatically on \"mouse\" hover",
65+
"description": "If set to true, the data tip is shown as soon as mouse hovers on a word.",
6666
"type": "boolean",
6767
"default": false
68+
},
69+
"hoverTime": {
70+
"title": "Hover/Stay Time",
71+
"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].",
72+
"type": "number",
73+
"default": 50
6874
}
6975
},
7076
"providedServices": {

0 commit comments

Comments
 (0)