Skip to content
Snippets Groups Projects
Commit 5c2fb121 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] web_calendar: reset dataset index if search result empty

parent 4a064b93
Branches
Tags
No related merge requests found
......@@ -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;
}
});
});
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment