mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add removeWord so that learning word removes all highlights for given word
This commit is contained in:
parent
a719ac6e6e
commit
c2d7809e05
2 changed files with 7 additions and 1 deletions
|
@ -45,6 +45,12 @@ define [
|
||||||
@highlights = @highlights.filter (hl) ->
|
@highlights = @highlights.filter (hl) ->
|
||||||
hl != highlight
|
hl != highlight
|
||||||
|
|
||||||
|
removeWord: (word) ->
|
||||||
|
@highlights.filter (highlight) ->
|
||||||
|
highlight.word == word
|
||||||
|
.forEach (highlight) =>
|
||||||
|
@removeHighlight(highlight)
|
||||||
|
|
||||||
clearRow: (row) ->
|
clearRow: (row) ->
|
||||||
@highlights.filter (highlight) ->
|
@highlights.filter (highlight) ->
|
||||||
highlight.range.start.row == row
|
highlight.range.start.row == row
|
||||||
|
|
|
@ -76,7 +76,7 @@ define [], () ->
|
||||||
|
|
||||||
learnWord: (highlight) =>
|
learnWord: (highlight) =>
|
||||||
@apiRequest "/learn", word: highlight.word
|
@apiRequest "/learn", word: highlight.word
|
||||||
@adapter.highlightedWordManager.removeHighlight highlight
|
@adapter.highlightedWordManager.removeWord highlight.word
|
||||||
language = @$scope.spellCheckLanguage
|
language = @$scope.spellCheckLanguage
|
||||||
@cache?.put("#{language}:#{highlight.word}", true)
|
@cache?.put("#{language}:#{highlight.word}", true)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue