(js) Fix pos. of personal calendar after rename

This commit is contained in:
Francis Lachapelle 2016-03-03 09:29:12 -05:00
parent 44f748659e
commit 540ed1f63b

View file

@ -93,8 +93,9 @@
list = this.$calendars; list = this.$calendars;
sibling = _.find(list, function(o) { sibling = _.find(list, function(o) {
return (o.id != 'personal' && return (calendar.id == 'personal' ||
o.name.localeCompare(calendar.name) === 1); (o.id != 'personal' &&
o.name.localeCompare(calendar.name) === 1));
}); });
i = sibling ? _.indexOf(_.pluck(list, 'id'), sibling.id) : 1; i = sibling ? _.indexOf(_.pluck(list, 'id'), sibling.id) : 1;
list.splice(i, 0, calendar); list.splice(i, 0, calendar);