FIX: Quoting a nested quote should preserve original post info.

This commit is contained in:
Vinoth Kannan 2020-03-28 22:24:43 +05:30
parent a3d47f1aad
commit 7a32a99595
2 changed files with 2 additions and 1 deletions

View File

@ -65,6 +65,7 @@ export default Component.extend({
opts.username = element.dataset.username || getQuoteTitle(element);
opts.post = element.dataset.post;
opts.topic = element.dataset.topic;
break;
}
}

View File

@ -149,7 +149,7 @@ export function selectedText() {
export function selectedElement() {
const selection = window.getSelection();
if (selection.rangeCount > 0) {
return selection.getRangeAt(0).startContainer.parentElement;
return selection.getRangeAt(0).commonAncestorContainer.parentElement;
}
}