Skip to content

Commit

Permalink
New mentions weren't highlighted after insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Virabyan committed May 6, 2015
1 parent 5b12ab2 commit 241e9cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion jquery.mentions.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ $.widget( "ui.areacomplete", $.ui.autocomplete,
value = before + newval + after
if @overriden.select
ui.item.pos = @start
ui.value = value
if @overriden.select(event, ui) == false
return false

Expand Down Expand Up @@ -273,7 +274,6 @@ class MentionsInput extends MentionsBase

for mention, i in @mentions[..]
piece = value.substring(mention.pos, mention.pos + mention.name.length)
console.log(mention.name, piece)
if mention.name != piece
@mentions.splice(i, 1)
@value = value
Expand All @@ -285,6 +285,7 @@ class MentionsInput extends MentionsBase

_onSelect: (event, ui) =>
@_addMention(name: ui.item.value, pos: ui.item.pos, uid: ui.item.uid)
@value = ui.value

_updateValue: =>
value = @input.val()
Expand Down
5 changes: 3 additions & 2 deletions jquery.mentions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 241e9cd

Please sign in to comment.