From 6d854395d799fa2661e89fe8fb9344c1eac3f595 Mon Sep 17 00:00:00 2001 From: Kathryn Killebrew Date: Mon, 1 Aug 2016 14:20:22 -0400 Subject: [PATCH] Show/hide reverse button Hide reverse origin/destination button if either field is empty. --- .../scripts/cac/control/cac-control-sidebar-directions.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/scripts/cac/control/cac-control-sidebar-directions.js b/src/app/scripts/cac/control/cac-control-sidebar-directions.js index 5cf99e4bb..31cc73c40 100644 --- a/src/app/scripts/cac/control/cac-control-sidebar-directions.js +++ b/src/app/scripts/cac/control/cac-control-sidebar-directions.js @@ -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) { @@ -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]);