Thanks for the plugin - small improvement to the position handling
Instead of roughly trying to calculate the selection box position, I used jquery-caret-position-getter (https://github.com/beviz/jquery-caret-position-getter) which will actually place the window below the caret is.
in default.php add (inside LoadLookup function):$Sender->AddJsFile($this->GetResource('js/jquery.caretposition.js', FALSE, FALSE));
Then in the js/query.js replace all the textarea position handling with:
var caretpos = $(context).getCaretPosition(); var boxleft = $(context).offset().left+caretpos.left; var boxtop = $(context).offset().top+caretpos.top; $('.MentionsLookup').css({'left':boxleft,'top':boxtop});
Tagged:
3
Comments
I will bare this in mind for a later date.
I'd probably do my own you have rangy to get the caret position (in order not to replicate), and then use some of these methods to get the offset.
grep is your friend.