Autocomplete base
This commit is contained in:
parent
b2ee91fd8f
commit
845591bce6
|
@ -0,0 +1,21 @@
|
||||||
|
$(function () {
|
||||||
|
$(".channel-textarea-inner textarea").ready(function () {
|
||||||
|
var availableTags = [
|
||||||
|
"Kappa",
|
||||||
|
"4Head"];
|
||||||
|
|
||||||
|
$("#tags").on("keydown", function () {
|
||||||
|
var newY = $(this).textareaHelper('caretPos').top + (parseInt($(this).css('font-size'), 10) * 1.5);
|
||||||
|
var newX = $(this).textareaHelper('caretPos').left;
|
||||||
|
var posString = "left+" + newX + "px top+" + newY + "px";
|
||||||
|
$(this).autocomplete("option", "position", {
|
||||||
|
my: "left top",
|
||||||
|
at: posString
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".channel-textarea-inner textarea").autocomplete({
|
||||||
|
source: availableTags
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue