From 2efe332b495787dc5be77c3191ff319a62a56fca Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 15 Sep 2013 07:43:13 -0400
Subject: [PATCH] Display full attachment name using title attribute when name is too long to display (#1489320)

---
 program/steps/mail/show.inc |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 59f4d55..9d85f9c 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -175,9 +175,9 @@
         $ol .= html::tag('li', null, Q(sprintf("%s (%s)", $filename, $size)));
       }
       else {
-        if (mb_strlen($filename) > 50) {
+        if ($attrib['maxlength'] && mb_strlen($filename) > $attrib['maxlength']) {
           $title    = $filename;
-          $filename = abbreviate_string($filename, 50);
+          $filename = abbreviate_string($filename, $attrib['maxlength']);
         }
         else {
           $title = '';
@@ -190,6 +190,7 @@
             'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false),
             'onclick' => sprintf('return %s.command(\'load-attachment\',\'%s\',this)',
               JS_OBJECT_NAME, $attach_prop->mime_id),
+            'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)',
             'title' => Q($title),
             ), Q($filename));
         $ol .= html::tag('li', array('class' => $class, 'id' => $id), $link);

--
Gitblit v1.9.1