I need to make 'rehighlighting' in the text. So basically I need remove prev highlight and create new one. But this code doesn't work, when I select text it just unselects everything, and it removes current highlight also instead of remove previous highlight and highlight new selection:
if (this.selObj) {
this.highlighter.removeHighlights(this.highlighter.highlights);
}
this.selObj = rangy.getSelection();
this.highlighter.highlightSelection('text-highlight');
rangy.getSelection().removeAllRanges();
So basically I want to implement single lighlight selection only, I need user to make only one highlighting of the whole text in one moment. Is that supported somehow atm?
I need to make 'rehighlighting' in the text. So basically I need remove prev highlight and create new one. But this code doesn't work, when I select text it just unselects everything, and it removes current highlight also instead of remove previous highlight and highlight new selection:
So basically I want to implement single lighlight selection only, I need user to make only one highlighting of the whole text in one moment. Is that supported somehow atm?