Last active
April 22, 2022 12:47
-
-
Save bjoerntx/325ccc4e93195fc95bee5ce573d97b8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawContextMenu() { | |
$("#formFieldContextMenu").tooltip("hide"); | |
// get the singleton context menu | |
_divOvr = document.getElementById("formFieldContextMenu"); | |
// retrieve the field location in the document | |
var fldPos = _currentField.textField.bounds; | |
// and calculate the offset location and zoom factor | |
var x = _textView.offsetLeft + (fldPos.location.x / 15 - _txtViewLoc.x) * _zoom; | |
var y = _textView.offsetTop + ((fldPos.location.y / 15) | |
+ (fldPos.size.height / 15) - _txtViewLoc.y) * _zoom; | |
// set position and size | |
_divOvr.style.zIndex = _textView.style.zIndex; | |
_divOvr.style.left = x + "px"; | |
_divOvr.style.top = y + 5 + "px"; | |
_divOvr.style.display = "flex"; | |
// show tooltip once | |
if (_tooltipShown === false) { | |
$("#formFieldContextMenu").tooltip("show"); | |
_tooltipShown = true; | |
} | |
else | |
$("#formFieldContextMenu").tooltip("disable"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment