diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-12-12 08:59:41 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-12-12 08:59:41 +0100 |
commit | 4187b3e26ff00b607d05cb9b588e83db18c3cab7 (patch) | |
tree | 65e2f2263cf96a7765e54d7fb303e5c0173a05ee /program/js/app.js | |
parent | d19c0f9f309cbe63411a8ddcbbda3daf7461a30d (diff) | |
parent | 48660a881c698e3cd45dcff5075c8541e178331d (diff) |
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/program/js/app.js b/program/js/app.js index bad8a2f9c..cbe61ab4a 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -5744,19 +5744,23 @@ function rcube_webmail() .prop({checked: subscribed ? true : false, disabled: is_protected ? true : false}); // add to folder/row-ID map - this.env.subscriptionrows[id] = [name, display_name, 0]; + this.env.subscriptionrows[id] = [name, display_name, false]; // sort folders (to find a place where to insert the row) // replace delimiter with \0 character to fix sorting // issue where 'Abc Abc' would be placed before 'Abc/def' var replace_from = RegExp(RegExp.escape(this.env.delimiter), 'g'), replace_to = String.fromCharCode(0); + $.each(this.env.subscriptionrows, function(k,v) { - var n = v[0]; - n = n.replace(replace_from, replace_to); - v.push(n); + if (v.length < 4) { + var n = v[0]; + n = n.replace(replace_from, replace_to); + v.push(n); + } folders.push(v); }); + folders.sort(function(a, b) { var len = a.length - 1; n1 = a[len], n2 = b[len]; return n1 < n2 ? -1 : 1; |