Fix regression where only first new folder was placed in correct place on the list (#1489472)

pull/158/merge
Aleksander Machniak 11 years ago
parent 7eecf873da
commit 302eb266de

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Fix regression where only first new folder was placed in correct place on the list (#1489472)
- Fix issue where children of selected and collapsed thread were skipped on various actions (#1489457) - Fix issue where children of selected and collapsed thread were skipped on various actions (#1489457)
- Fix issue where groups were not deleted when "Replace entire addressbook" option on contacts import was used (#1489420) - Fix issue where groups were not deleted when "Replace entire addressbook" option on contacts import was used (#1489420)
- Fix unreliable mimetype tests in Installer (#1489453) - Fix unreliable mimetype tests in Installer (#1489453)

@ -5744,19 +5744,23 @@ function rcube_webmail()
.prop({checked: subscribed ? true : false, disabled: is_protected ? true : false}); .prop({checked: subscribed ? true : false, disabled: is_protected ? true : false});
// add to folder/row-ID map // 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) // sort folders (to find a place where to insert the row)
// replace delimiter with \0 character to fix sorting // replace delimiter with \0 character to fix sorting
// issue where 'Abc Abc' would be placed before 'Abc/def' // issue where 'Abc Abc' would be placed before 'Abc/def'
var replace_from = RegExp(RegExp.escape(this.env.delimiter), 'g'), var replace_from = RegExp(RegExp.escape(this.env.delimiter), 'g'),
replace_to = String.fromCharCode(0); replace_to = String.fromCharCode(0);
$.each(this.env.subscriptionrows, function(k,v) { $.each(this.env.subscriptionrows, function(k,v) {
var n = v[0]; if (v.length < 4) {
n = n.replace(replace_from, replace_to); var n = v[0];
v.push(n); n = n.replace(replace_from, replace_to);
v.push(n);
}
folders.push(v); folders.push(v);
}); });
folders.sort(function(a, b) { folders.sort(function(a, b) {
var len = a.length - 1; n1 = a[len], n2 = b[len]; var len = a.length - 1; n1 = a[len], n2 = b[len];
return n1 < n2 ? -1 : 1; return n1 < n2 ? -1 : 1;

Loading…
Cancel
Save