diff --git a/assets/src/scripts/components/hydrograph/index.js b/assets/src/scripts/components/hydrograph/index.js index c7940a9dec7308f11325e6983a344fec8822dc57..a6d840887dd9c15934b247e6bdbd51163ac1f5c8 100644 --- a/assets/src/scripts/components/hydrograph/index.js +++ b/assets/src/scripts/components/hydrograph/index.js @@ -334,14 +334,6 @@ const graphControls = function(elem) { .classed('usa-unstyled-list', true) .classed('graph-controls-container', true); - graphControlDiv.call(link(function(elem, layout) { - if (!mediaQuery(USWDS_MEDIUM_SCREEN)) { - elem.style('padding-left', `${layout.margin.left}px`); - } else { - elem.style('padding-left', null); - } - }, layoutSelector)); - graphControlDiv.append('li') .call(audibleUI); diff --git a/assets/src/scripts/components/hydrograph/legend.js b/assets/src/scripts/components/hydrograph/legend.js index 4bcbc395c04d762840270711feb8124edf204d48..85c178f4314655cc1658c375047e8612cc9dcbd8 100644 --- a/assets/src/scripts/components/hydrograph/legend.js +++ b/assets/src/scripts/components/hydrograph/legend.js @@ -7,7 +7,9 @@ const { defineLineMarker, defineTextOnlyMarker, defineCircleMarker, defineRectan const { currentVariableLineSegmentsSelector, HASH_ID, MASK_DESC} = require('./drawingData'); const { currentVariableTimeSeriesSelector } = require('./timeSeries'); +const { USWDS_MEDIUM_SCREEN } = require('../../config'); const { getMethods } = require('../../selectors/timeSeriesSelector'); +const { mediaQuery } = require('../../utils'); const TS_LABEL = { 'current': 'Current: ', @@ -123,7 +125,7 @@ export const drawSimpleLegend = function(div, {legendMarkerRows, layout}) { let legend = svg .append('g') .attr('class', 'legend') - .attr('transform', `translate(${layout.margin.left}, 0)`); + .attr('transform', `translate(${mediaQuery(USWDS_MEDIUM_SCREEN) ? layout.margin.left : 0}, 0)`); legendMarkerRows.forEach((rowMarkers, rowIndex) => { let xPosition = 0;