Skip to content

Commit 1791063

Browse files
committed
Merge remote-tracking branch 'ichord/master' into at-empty
2 parents d6dba68 + 330a427 commit 1791063

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/default.coffee

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
KEY_CODE =
2-
DOWN: 40
3-
UP: 38
42
ESC: 27
53
TAB: 9
64
ENTER: 13
@@ -11,7 +9,7 @@ KEY_CODE =
119
LEFT: 37
1210
UP:38
1311
RIGHT: 39
14-
DOWN:40
12+
DOWN: 40
1513
BACKSPACE: 8
1614
SPACE: 32
1715

@@ -126,7 +124,7 @@ DEFAULT_CALLBACKS =
126124
# @return [String] highlighted string.
127125
highlighter: (li, query) ->
128126
return li if not query
129-
regexp = new RegExp(">\\s*(\\w*?)(" + query.replace("+","\\+") + ")(\\w*)\\s*<", 'ig')
127+
regexp = new RegExp(">\\s*([^\<]*?)(" + query.replace("+","\\+") + ")([^\<]*)\\s*<", 'ig')
130128
li.replace regexp, (str, $1, $2, $3) -> '> '+$1+'<strong>' + $2 + '</strong>'+$3+' <'
131129

132130
# What to do before inserting item's value into inputor.

src/editableController.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,12 @@ class EditableController extends Controller
158158
.addClass 'atwho-inserted'
159159
.html content
160160
.attr 'data-atwho-at-query', "" + data['atwho-at'] + @query.text
161+
.attr 'contenteditable', "false"
161162
if range = @_getRange()
162163
if @query.el.length
163164
range.setEndAfter @query.el[0]
164165
range.collapse false
165-
range.insertNode suffixNode = @app.document.createTextNode "\u200D" + suffix
166+
range.insertNode suffixNode = @app.document.createTextNode "" + suffix
166167
@_setRange 'after', suffixNode, range
167168
@$inputor.focus() unless @$inputor.is ':focus'
168169
@$inputor.change()

src/view.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class View
4444
#
4545
# @return [Boolean]
4646
visible: ->
47-
@$el.is(":visible")
47+
$.expr.filters.visible(@$el[0])
4848

4949
highlighted: ->
5050
@$el.find(".cur").length > 0

0 commit comments

Comments
 (0)