From 5793e7f81747714e0ed6cc7acff1e54c91c57136 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Wed, 14 Aug 2013 16:32:35 -0400
Subject: [PATCH] Make thread toggles work on touch devices

---
 program/js/app.js |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 04fb9cd..78ac4c6 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -398,7 +398,7 @@
         }
         else if (this.env.action == 'edit-folder' && this.gui_objects.editform) {
           this.enable_command('save', 'folder-size', true);
-          parent.rcmail.env.messagecount = this.env.messagecount;
+          parent.rcmail.env.exists = this.env.messagecount;
           parent.rcmail.enable_command('purge', this.env.messagecount);
           $("input[type='text']").first().select();
         }
@@ -1731,6 +1731,14 @@
     if (!row.depth && row.has_children && (expando = document.getElementById('rcmexpando'+row.uid))) {
       row.expando = expando;
       expando.onmousedown = function(e) { return self.expand_message_row(e, uid); };
+      if (bw.mobile) {
+        expando.addEventListener('touchend', function(e) {
+          if (e.changedTouches.length == 1) {
+            self.expand_message_row(e, uid);
+            return rcube_event.cancel(e);
+          }
+        }, false);
+      }
     }
 
     this.triggerEvent('insertrow', { uid:uid, row:row });
@@ -4995,7 +5003,7 @@
   this.replace_contact_photo = function(id)
   {
     var img_src = id == '-del-' ? this.env.photo_placeholder :
-      this.env.comm_path + '&_action=photo&_source=' + this.env.source + '&_cid=' + this.env.cid + '&_photo=' + id;
+      this.env.comm_path + '&_action=photo&_source=' + this.env.source + '&_cid=' + (this.env.cid || 0) + '&_photo=' + id;
 
     this.set_photo_actions(id);
     $(this.gui_objects.contactphoto).children('img').attr('src', img_src);
@@ -6437,6 +6445,7 @@
 
           if ((response.action == 'list' || response.action == 'search') && this.message_list) {
             this.msglist_select(this.message_list);
+            this.message_list.resize();
             this.triggerEvent('listupdate', { folder:this.env.mailbox, rowcount:this.message_list.rowcount });
           }
         }
@@ -6447,6 +6456,7 @@
             this.enable_command('search-create', this.env.source == '');
             this.enable_command('search-delete', this.env.search_id);
             this.update_group_commands();
+            this.contact_list.resize();
             this.triggerEvent('listupdate', { folder:this.env.source, rowcount:this.contact_list.rowcount });
           }
         }

--
Gitblit v1.9.1