Merge pull request #539 from singjie/master

Fix contextMenu when accessing editor requires scrolling
This commit is contained in:
Fabian Jakobs 2011-12-01 09:42:29 -08:00
commit 50ba6fa664
2 changed files with 5 additions and 2 deletions

View file

@ -96,7 +96,7 @@ function DefaultHandlers(editor) {
editor.moveCursorToPosition(pos);
}
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);
}
return;

View file

@ -51,6 +51,9 @@ var MouseEvent = exports.MouseEvent = function(domEvent, editor) {
this.pageX = event.getDocumentX(domEvent);
this.pageY = event.getDocumentY(domEvent);
this.clientX = domEvent.clientX;
this.clientY = domEvent.clientY;
this.$pos = null;
this.$inSelection = null;
@ -134,4 +137,4 @@ var MouseEvent = exports.MouseEvent = function(domEvent, editor) {
}).call(MouseEvent.prototype);
});
});