Merge pull request #539 from singjie/master
Fix contextMenu when accessing editor requires scrolling
This commit is contained in:
commit
50ba6fa664
2 changed files with 5 additions and 2 deletions
|
|
@ -96,7 +96,7 @@ function DefaultHandlers(editor) {
|
||||||
editor.moveCursorToPosition(pos);
|
editor.moveCursorToPosition(pos);
|
||||||
}
|
}
|
||||||
if(button == 2) {
|
if(button == 2) {
|
||||||
editor.textInput.onContextMenu({x: pageX, y: pageY}, selectionEmpty);
|
editor.textInput.onContextMenu({x: ev.clientX, y: ev.clientY}, selectionEmpty);
|
||||||
event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose);
|
event.capture(editor.container, function(){}, editor.textInput.onContextMenuClose);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,9 @@ var MouseEvent = exports.MouseEvent = function(domEvent, editor) {
|
||||||
this.pageX = event.getDocumentX(domEvent);
|
this.pageX = event.getDocumentX(domEvent);
|
||||||
this.pageY = event.getDocumentY(domEvent);
|
this.pageY = event.getDocumentY(domEvent);
|
||||||
|
|
||||||
|
this.clientX = domEvent.clientX;
|
||||||
|
this.clientY = domEvent.clientY;
|
||||||
|
|
||||||
this.$pos = null;
|
this.$pos = null;
|
||||||
this.$inSelection = null;
|
this.$inSelection = null;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue