Skip to content

Commit

Permalink
Fixed broken methods for contenteditable ivirabyan#49
Browse files Browse the repository at this point in the history
  • Loading branch information
ivirabyan committed Dec 29, 2015
1 parent 08be491 commit 3d9eb96
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
11 changes: 10 additions & 1 deletion jquery.mentions.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,21 @@ class MentionsContenteditable extends MentionsBase

getValue: ->
value = @input.clone()
markupMention = @_markupMention
$(@selector, value).replaceWith ->
uid = $(this).data 'mention'
name = $(this).text()
return @_markupMention({name: name, uid: uid})
return markupMention({name: name, uid: uid})
value.html().replace(@marker, '')

getMentions: ->
mentions = []
$(@selector, @input).each ->
mentions.push
uid: $(this).data 'mention'
name: $(this).text()
return mentions

clear: ->
@input.html('')
@_update()
Expand Down
17 changes: 15 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 3d9eb96

Please sign in to comment.