From 7a5c3a3224bb59740aafceae89d236b19c2d8808 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 14 Apr 2014 14:41:27 -0400
Subject: [PATCH] Fix regression where title attribute for long message subjects wasn't used on IE

---
 program/js/list.js |    4 +++-
 program/js/app.js  |   15 ++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 2cc14a7..45e8dbe 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1936,7 +1936,7 @@
     // add each submitted col
     for (n in this.env.listcols) {
       c = this.env.listcols[n];
-      col = { className: String(c).toLowerCase() };
+      col = {className: String(c).toLowerCase(), events:{}};
 
       if (this.env.coltypes[c] && this.env.coltypes[c].hidden) {
         col.className += ' hidden';
@@ -1970,11 +1970,8 @@
       else if (c == 'threads')
         html = expando;
       else if (c == 'subject') {
-        if (bw.ie) {
-          col.onmouseover = function() { rcube_webmail.long_subject_title_ex(this, message.depth+1); };
-          if (bw.ie8)
-            tree = '<span></span>' + tree; // #1487821
-        }
+        if (bw.ie)
+          col.events.mouseover = function() { rcube_webmail.long_subject_title_ex(this); };
         html = tree + cols[c];
       }
       else if (c == 'priority') {
@@ -4102,7 +4099,7 @@
     li.attr('id', name)
       .addClass(att.classname)
       .html(att.html)
-      .on('mouseover', function() { rcube_webmail.long_subject_title_ex(this, 0); });
+      .on('mouseover', function() { rcube_webmail.long_subject_title_ex(this); });
 
     // replace indicator's li
     if (upload_id && (indicator = document.getElementById(upload_id))) {
@@ -7862,7 +7859,7 @@
   }
 };
 
-rcube_webmail.long_subject_title_ex = function(elem, indent)
+rcube_webmail.long_subject_title_ex = function(elem)
 {
   if (!elem.title) {
     var $elem = $(elem),
@@ -7874,7 +7871,7 @@
       w = tmp.width();
 
     tmp.remove();
-    if (w + indent * 15 > $elem.width())
+    if (w + $('span.branch', $elem).width() * 15 > $elem.width())
       elem.title = txt;
   }
 };
diff --git a/program/js/list.js b/program/js/list.js
index 9b7779c..a39bb5a 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -301,11 +301,13 @@
     if (row.style) $.extend(domrow.style, row.style);
     if (row.uid) $(domrow).data('uid', row.uid);
 
-    for (var domcell, col, i=0; row.cols && i < row.cols.length; i++) {
+    for (var e, domcell, col, i=0; row.cols && i < row.cols.length; i++) {
       col = row.cols[i];
       domcell = document.createElement(this.col_tagname());
       if (col.className) domcell.className = col.className;
       if (col.innerHTML) domcell.innerHTML = col.innerHTML;
+      for (e in col.events)
+        domcell['on' + e] = col.events[e];
       domrow.appendChild(domcell);
     }
 

--
Gitblit v1.9.1