only reset origin input if needed

This commit is contained in:
Laura Klünder 2017-10-30 18:21:34 +01:00
parent d6a08e187e
commit 3030c264f4

View file

@ -32,8 +32,9 @@ c3nav = {
view = ($origin.data('location') === null || $destination.data('location') === null) ? 'route-search' : 'route-result';
} else {
view = ($destination.data('location') === null) ? 'search' : 'location';
// todo only if needed
c3nav._locationinput_set($origin, null);
if ($origin.data('location') !== null) {
c3nav._locationinput_set($origin, null);
}
}
c3nav._view = view;
$('main').attr('data-view', view);