[FIX] web_calendar: reset dataset index if search result empty
This commit is contained in:
parent
4a064b9374
commit
5c2fb121ca
|
@ -393,6 +393,13 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
|||
}).done(function(events) {
|
||||
self.dataset_events = events;
|
||||
self.events_loaded(events);
|
||||
if (self.dataset.index === null) {
|
||||
if (events.length) {
|
||||
self.dataset.index = 0;
|
||||
}
|
||||
} else if (self.dataset.index >= events.length) {
|
||||
self.dataset.index = events.length ? 0 : null;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue