Move repositionAllMarkup() upstream
This commit is contained in:
parent
6b92aeb11a
commit
e1b4bfb2c0
45
service2.js
45
service2.js
@ -308,6 +308,21 @@ class BesService {
|
||||
popup.show(source.clientX, source.clientY)
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates all grammar mistake markup positions.
|
||||
*/
|
||||
repositionAllMarkup() {
|
||||
this.results.forEach(result => {
|
||||
result.matches.forEach(match => {
|
||||
if (match.highlights) match.highlights.forEach(h => h.remove())
|
||||
match.highlights = this.addMistakeMarkup(
|
||||
match.range,
|
||||
match.match.rule.id
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces grammar checking match with a suggestion provided by grammar checking service.
|
||||
*
|
||||
@ -563,21 +578,6 @@ class BesTreeService extends BesService {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates all grammar mistake markup positions.
|
||||
*/
|
||||
repositionAllMarkup() {
|
||||
this.results.forEach(result => {
|
||||
result.matches.forEach(match => {
|
||||
if (match.highlights) match.highlights.forEach(h => h.remove())
|
||||
match.highlights = this.addMistakeMarkup(
|
||||
match.range,
|
||||
match.match.rule.id
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears given block element grammar mistake markup.
|
||||
*
|
||||
@ -1318,21 +1318,6 @@ class BesPlainTextService extends BesService {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates all grammar mistake markup positions.
|
||||
*/
|
||||
repositionAllMarkup() {
|
||||
this.results.forEach(result => {
|
||||
result.matches.forEach(match => {
|
||||
if (match.highlights) match.highlights.forEach(h => h.remove())
|
||||
match.highlights = this.addMistakeMarkup(
|
||||
match.range,
|
||||
match.match.rule.id
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears given paragraph grammar mistake markup.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user