[evolution] Bug 770067 - [WK2] Misplaced cursor on reply in HTML
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 770067 - [WK2] Misplaced cursor on reply in HTML
- Date: Mon, 3 Oct 2016 12:42:46 +0000 (UTC)
commit 2a9becc430eacecb2290e3403c387fcadfc6d82f
Author: Tomas Popela <tpopela redhat com>
Date: Mon Oct 3 14:36:40 2016 +0200
Bug 770067 - [WK2] Misplaced cursor on reply in HTML
The wrong code path was chosen because the code determined that the BODY
already contains an existing paragraph on the end of the content. The
fix it to not take the credits element into account when determining if the
BODY already contains the paragraphs.
.../web-extension/e-composer-dom-functions.c | 11 ++++++++++-
.../web-extension/e-editor-dom-functions.c | 3 ++-
2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/modules/webkit-editor/web-extension/e-composer-dom-functions.c
b/modules/webkit-editor/web-extension/e-composer-dom-functions.c
index 79358ce..32e517a 100644
--- a/modules/webkit-editor/web-extension/e-composer-dom-functions.c
+++ b/modules/webkit-editor/web-extension/e-composer-dom-functions.c
@@ -113,10 +113,19 @@ move_caret_after_signature_inserted (EEditorPage *editor_page)
paragraphs = webkit_dom_document_query_selector_all (document, "[data-evo-paragraph]", NULL);
signature = webkit_dom_document_query_selector (document, ".-x-evo-signature-wrapper", NULL);
/* Situation when wrapped paragraph is just in signature and not in message body */
- if (webkit_dom_node_list_get_length (paragraphs) == 1)
+ if (webkit_dom_node_list_get_length (paragraphs) == 1) {
+ WebKitDOMNode *node;
+
+ node = webkit_dom_node_list_item (paragraphs, 0);
+
if (signature && webkit_dom_element_query_selector (signature, "[data-evo-paragraph]", NULL))
has_paragraphs_in_body = FALSE;
+ /* Don't take the credentials into account. */
+ if (!webkit_dom_node_get_previous_sibling (node))
+ has_paragraphs_in_body = FALSE;
+ }
+
/*
*
* Keeping Signatures in the beginning of composer
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
index fc58d41..81df021 100644
--- a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -9380,7 +9380,8 @@ e_editor_dom_fix_structure_after_delete_before_quoted_content (EEditorPage *edit
e_editor_dom_selection_restore (editor_page);
save_history_for_delete_or_backspace (
editor_page, key_code == HTML_KEY_CODE_DELETE, control_key);
- }
+ } else
+ e_editor_dom_selection_restore (editor_page);
/* Remove the empty block and move caret to the right place. */
remove_node (block);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]