aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-29 18:57:14 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-29 19:09:20 +0800
commit2d251a9597311d4eaaa73556c2c72af5fe62a86e (patch)
treedbe26f989390d5131eb3a70a57fe4bc3c9b6fb63 /em-format
parentfa39ba7c5dba1ce355fa560a1e46c542fb34a1b2 (diff)
downloadgsoc2013-evolution-2d251a9597311d4eaaa73556c2c72af5fe62a86e.tar
gsoc2013-evolution-2d251a9597311d4eaaa73556c2c72af5fe62a86e.tar.gz
gsoc2013-evolution-2d251a9597311d4eaaa73556c2c72af5fe62a86e.tar.bz2
gsoc2013-evolution-2d251a9597311d4eaaa73556c2c72af5fe62a86e.tar.lz
gsoc2013-evolution-2d251a9597311d4eaaa73556c2c72af5fe62a86e.tar.xz
gsoc2013-evolution-2d251a9597311d4eaaa73556c2c72af5fe62a86e.tar.zst
gsoc2013-evolution-2d251a9597311d4eaaa73556c2c72af5fe62a86e.zip
Distinguish "attachment-wrapper" elements from attachments.
The HTML for attachments always has the following form: <div class="attachment-wrapper" id="something" style="display: block;"> <actual attachment element> </div> The <div> element controls attachment visibility through its "display" style attribute, which is either "block" or "none". Problem is the <actual attachment element> was getting the same ID as its parent <div> element. So when either element was requested by ID, in certain cases the wrong element was returned and caused misbehavior and console warnings. Solve this by adding a "wrapper" suffix to the <div> element ID. So in the example above, id="something" gets the <actual attachment element>, whereas id="something.wrapper" gets the <div> element.
Diffstat (limited to 'em-format')
-rw-r--r--em-format/e-mail-formatter-attachment.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c
index 50fbe844f3..9e44901fce 100644
--- a/em-format/e-mail-formatter-attachment.c
+++ b/em-format/e-mail-formatter-attachment.c
@@ -316,10 +316,15 @@ emfe_attachment_format (EMailFormatterExtension *extension,
}
if (success) {
+ gchar *wrapper_element_id;
+
+ wrapper_element_id = g_strconcat (
+ attachment_part_id, ".wrapper", NULL);
+
str = g_strdup_printf (
"<tr><td colspan=\"2\">"
"<div class=\"attachment-wrapper\" id=\"%s\">",
- attachment_part_id);
+ wrapper_element_id);
camel_stream_write_string (
stream, str, cancellable, NULL);
@@ -333,6 +338,7 @@ emfe_attachment_format (EMailFormatterExtension *extension,
camel_stream_write_string (
stream, "</div></td></tr>", cancellable, NULL);
+ g_free (wrapper_element_id);
g_free (str);
}