Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deep assign objects, hide instructions #104

Merged
merged 2 commits into from
Dec 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.0.3

- [bug] re-enable hiding instructions panel [#101](https://github.com/mapbox/mapbox-gl-directions/issues/101)

## 3.0.2

- [bug] Fixing a fix for `3.0.1`. Missed a single space.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"webworkify-webpack": "1.1.7"
},
"dependencies": {
"deep-assign": "^2.0.0",
"lodash.debounce": "^4.0.6",
"lodash.isequal": "^4.2.0",
"lodash.template": "^4.2.5",
Expand Down
4 changes: 2 additions & 2 deletions src/directions.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ export default class MapboxDirections {
new Inputs(inputEl, store, this.actions, this._map);

const directionsEl = document.createElement('div');
directionsEl.className = 'directions-control-directions-container';
directionsEl.className = 'directions-control directions-control-instructions';

new Instructions(directionsEl, store, {
hoverMarker: this.actions.hoverMarker,
setRouteIndex: this.actions.setRouteIndex
}, this._map);

if (controls.inputs) el.appendChild(inputEl);
el.appendChild(directionsEl);
if (controls.instructions) el.appendChild(directionsEl);

this.subscribedActions();
if (this._map.loaded()) this.mapState()
Expand Down
3 changes: 2 additions & 1 deletion src/reducers/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as types from '../constants/action_types.js';
import deepAssign from 'deep-assign';

const initialState = {
// Options set on initialization
Expand Down Expand Up @@ -42,7 +43,7 @@ const initialState = {
function data(state = initialState, action) {
switch (action.type) {
case types.SET_OPTIONS:
return Object.assign({}, state, action.options);
return deepAssign({}, state, action.options);

case types.DIRECTIONS_PROFILE:
return Object.assign({}, state, {
Expand Down