|
76 | 76 | this.timeout = null; |
77 | 77 | this.hasGutter = hasGutter; |
78 | 78 | this.onMouseOver = function(e) { onMouseOver(cm, e); }; |
| 79 | + this.onClick = function(e) { onClick(cm, e); }; |
79 | 80 | this.waitingFor = 0 |
80 | 81 | } |
81 | 82 |
|
|
235 | 236 | var ann = spans[i].__annotation; |
236 | 237 | if (ann) annotations.push(ann); |
237 | 238 | } |
238 | | - if (annotations.length) popupTooltips(cm, annotations, e); |
| 239 | + |
| 240 | + if (annotations.length) cb(cm, annotations, e) |
| 241 | + } |
| 242 | + |
| 243 | + function onMouseOver(cm, e) { |
| 244 | + handleMarkerAction(cm, e, popupTooltips) |
| 245 | + } |
| 246 | + |
| 247 | + function onClick (cm, e) { |
| 248 | + handleMarkerAction(cm, e, function popupContextMenu (cm, annotations, e) { |
| 249 | + console.log(`WIP: click action, ${JSON.stringify(annotations)}`) |
| 250 | + }) |
239 | 251 | } |
240 | 252 |
|
241 | 253 | CodeMirror.defineOption("lint", false, function(cm, val, old) { |
|
256 | 268 | cm.on("change", onChange); |
257 | 269 | if (state.options.tooltips != false && state.options.tooltips != "gutter") |
258 | 270 | CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); |
| 271 | + if (state.options.contextmenu) { |
| 272 | + CodeMirror.on(cm.getWrapperElement(), "click", state.onClick); |
| 273 | + } |
259 | 274 |
|
260 | 275 | startLinting(cm); |
261 | 276 | } |
|
0 commit comments