Skip to content

Instantly share code, notes, and snippets.

@jharding
Last active January 1, 2016 14:09
Show Gist options
  • Save jharding/8156049 to your computer and use it in GitHub Desktop.
Save jharding/8156049 to your computer and use it in GitHub Desktop.
.example-arabic .tt-dropdown-menu {
text-align: right;
}
<div class="example-arabic">
<input class="typeahead" type="text" placeholder="نعم">
</div>
var arabic = new Bloodhound({
datumTokenizer: function(d) { return Bloodhound.tokenizers.whitespace(d.word); },
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: [
{ word: "الإنجليزية" },
{ word: "نعم" },
{ word: "لا" },
{ word: "مرحبا" },
{ word: "أهلا" }
]
});
arabic.initialize();
$('.example-arabic .typeahead').typeahead({
hint: false
},
{
name: 'arabic',
displayKey: 'word',
source: arabic.ttAdapter()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment