bugfix
This commit is contained in:
parent
f8a7234200
commit
af34537c5b
1 changed files with 9 additions and 8 deletions
|
@ -41,7 +41,7 @@ module tagIt {
|
|||
this.tagStorageService.deleteTagById(evt.target.parentElement.id);
|
||||
}
|
||||
else if (this.findSelectedText()) {
|
||||
updateSavedSelection();
|
||||
this.updateSavedSelection();
|
||||
callbackOnSelectFunc(joinLongWords(this.findSelectedText()));
|
||||
} else {
|
||||
callbackOnDeSelectFunc();
|
||||
|
@ -59,12 +59,6 @@ module tagIt {
|
|||
theSurroundingSpanElement.parentNode
|
||||
.replaceChild(theOriginalTextNode, theSurroundingSpanElement);
|
||||
}
|
||||
function updateSavedSelection() {
|
||||
if (this.savedSelection) {
|
||||
rangy.removeMarkers(this.savedSelection);
|
||||
}
|
||||
this.savedSelection = rangy.saveSelection();
|
||||
}
|
||||
}
|
||||
|
||||
findSelectedText() {
|
||||
|
@ -85,7 +79,7 @@ module tagIt {
|
|||
range, true, document.getElementById('tagit-body'));
|
||||
var generatedUuid: string = uuid.v4();
|
||||
var parentElement = <HTMLElement>range.commonAncestorContainer;
|
||||
|
||||
|
||||
return {
|
||||
id: generatedUuid,
|
||||
userEmail: 'testEmail',
|
||||
|
@ -154,6 +148,13 @@ module tagIt {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private updateSavedSelection() {
|
||||
if (this.savedSelection) {
|
||||
rangy.removeMarkers(this.savedSelection);
|
||||
}
|
||||
this.savedSelection = rangy.saveSelection();
|
||||
}
|
||||
|
||||
private surroundRangeWithSpan(sense: ISense, range: Range, uuid: string) {
|
||||
// add span around content
|
||||
|
|
Loading…
Reference in a new issue