[Email] Fixed issue with insertion of inline images 98/82998/1
authorIgor Nazarov <i.nazarov@samsung.com>
Fri, 5 Aug 2016 10:28:03 +0000 (13:28 +0300)
committerIgor Nazarov <i.nazarov@samsung.com>
Mon, 8 Aug 2016 13:22:31 +0000 (16:22 +0300)
- Caret position was in wrong place after image is inserted
- Was not possible to easily delete an image inserted inside a signature.

Change-Id: I658f7d625ae6a28cfb6fda04b3f0bdd702be9cda

modules/composer/inc/email-composer-js.h
res/misc/email-composer.css
res/misc/email-composer.js

index ebb9f3b..d2e21ad 100644 (file)
@@ -55,7 +55,7 @@
 #define EC_TAG_DIV_F "</div>"
 #define EC_TAG_DIV_DIR EC_TAG_DIV_DIR_S"<br>"EC_TAG_DIV_F
 #define EC_TAG_SIGNATURE_DEFAULT EC_TAG_DIV_DIR
-#define EC_TAG_SIGNATURE_TEXT EC_TAG_DIV_DIR""EC_TAG_DIV_DIR""EC_TAG_DIV_DIR""EC_TAG_DIV_DIR_S"<span style='font-size: 14px; color: rgba(%d, %d, %d, %d);'>%s</span>"EC_TAG_DIV_F
+#define EC_TAG_SIGNATURE_TEXT EC_TAG_DIV_DIR""EC_TAG_DIV_DIR""EC_TAG_DIV_DIR"<div dir='auto' style='font-size: 14px; color: rgba(%d, %d, %d, %d);'>%s"EC_TAG_DIV_F
 #define EC_TAG_BODY_CSS_START "<body class='css-body'>\n"
 #define EC_TAG_BODY_ORIGINAL_MESSAGE_START "<body class='css-body-IncludeOriginalMessage'>\n"
 #define EC_TAG_BODY_END "</body>\n"
index 6dbba5d..908aaf4 100644 (file)
@@ -37,7 +37,6 @@ html {
        background-color:#ffffff !important;
        overflow-x: auto;
        overflow-y: hidden;
-       backface-visibility: hidden;
        word-wrap: break-word;
 }
 
@@ -54,7 +53,6 @@ html {
        text-align: initial !important; /* initial: For LTR, left. For RTL, right */
        background-color:#ffffff !important;
        overflow: hidden;
-       backface-visibility: hidden;
        word-wrap: break-word;
 }
 
index c64ee0a..9de15a8 100644 (file)
@@ -930,7 +930,7 @@ function InsertImage(fileUri) {
                img.style.cssText = G_VAL_IMAGE_STYLE;
        }
        img.src = fileUri;
-       img.style.display = "none";
+       img.style.cssText = "position: absolute; visibility: hidden;";
 
        range.deleteContents();
        range.insertNode(img);
@@ -1076,7 +1076,7 @@ function GetCaretPosition(force) {
                        g_lastRange = range;
                } else {
                        var span = document.createElement("span");
-                       span.style.cssFloat = "left";
+                       span.style.position = "absolute";
                        span.appendChild(document.createTextNode("\u200b"));
                        range.insertNode(span);
                        var rects = range.getClientRects();