add auto-completion for +1, -1 emoji

This commit is contained in:
Nihad Abbasov 2012-09-25 04:56:21 -07:00
parent c3efcf7a62
commit 6df515a56d

View file

@ -39,6 +39,12 @@
:javascript
$(function(){
var names = #{@project.users.pluck(:name)};
$('.note-text').atWho('@', { data: names });
var names = #{@project.users.pluck(:name)}, emoji = ['+1', '-1'];
var emoji = $.map(emoji, function(value, i) {return {key:value + ':', name:value}});
$('#note_note').
atWho('@', { data: names }).
atWho(':', {
data: emoji,
tpl: "<li data-value='${key}'>${name} #{escape_javascript image_tag('emoji/${name}.png', :size => '20x20')}</li>"
});
});