From b45b15e5a8ac8f3265bea989b47273355379b89d Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 16 Aug 2015 08:01:19 -0400
Subject: [PATCH] Fix selecting a folder on collapse when any subfolder is selected

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

diff --git a/program/js/app.js b/program/js/app.js
index d82d8c6..53d678c 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1615,8 +1615,8 @@
 
       // select the folder if one of its childs is currently selected
       // don't select if it's virtual (#1488346)
-      if (!node.virtual && this.env.mailbox && this.env.mailbox.startsWith(name + this.env.delimiter))
-        this.command('list', name);
+      if (!node.virtual && this.env.mailbox && this.env.mailbox.startsWith(node.id + this.env.delimiter))
+        this.command('list', node.id);
     }
     else {
       var reg = new RegExp('&'+urlencode(node.id)+'&');

--
Gitblit v1.9.1