Skip to content

Commit

Permalink
Show/hide reverse button
Browse files Browse the repository at this point in the history
Hide reverse origin/destination button if either field is empty.
  • Loading branch information
flibbertigibbet committed Aug 1, 2016
1 parent f90a4bc commit 6d85439
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/scripts/cac/control/cac-control-sidebar-directions.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ CAC.Control.SidebarDirections = (function (_, $, Control, BikeModeOptions, Geoco
directions[key] = null;
UserPreferences.clearLocation(key);
mapControl.clearDirectionsMarker(key);
// hide reverse origin/destination button
$(options.selectors.reverseButton).css('visibility', 'hidden');
}

function onTypeaheadSelected(event, key, location) {
Expand All @@ -338,6 +340,9 @@ CAC.Control.SidebarDirections = (function (_, $, Control, BikeModeOptions, Geoco
return;
}

// show reverse origin/destination button
$(options.selectors.reverseButton).css('visibility', 'visible');

// save text for address to preferences
UserPreferences.setLocation(key, location);
setDirections(key, [location.feature.geometry.y, location.feature.geometry.x]);
Expand Down

0 comments on commit 6d85439

Please sign in to comment.