fix contextmenu for editor with border
This commit is contained in:
parent
2f55065e84
commit
1a9686c6b7
1 changed files with 5 additions and 2 deletions
|
|
@ -374,9 +374,12 @@ var TextInput = function(parentNode, host) {
|
|||
resetSelection(host.selection.isEmpty());
|
||||
host._emit("nativecontextmenu", {target: host});
|
||||
var rect = host.container.getBoundingClientRect();
|
||||
var style = dom.computedStyle(host.container);
|
||||
var top = rect.top + (parseInt(style.borderTopWidth) || 0);
|
||||
var left = rect.left + (parseInt(rect.borderLeftWidth) || 0);
|
||||
var move = function(e) {
|
||||
text.style.left = e.clientX - rect.left - 2 + "px";
|
||||
text.style.top = e.clientY - rect.top - 2 + "px";
|
||||
text.style.left = e.clientX - left - 2 + "px";
|
||||
text.style.top = e.clientY - top - 2 + "px";
|
||||
};
|
||||
move(e);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue