Skip to content

Commit

Permalink
Reset query panel on exit. Fixes #1457
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnafu committed Feb 15, 2017
1 parent c999ddb commit 4c7eef1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/client/actions/wfsquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const RESET_QUERY = 'RESET_QUERY';
const axios = require('../libs/ajax');
const {toggleControl, setControlProperty} = require('./controls');
const FilterUtils = require('../utils/FilterUtils');
const {reset} = require('./queryform');

function featureTypeSelected(url, typeName) {
return {
type: FEATURE_TYPE_SELECTED,
Expand Down Expand Up @@ -157,6 +159,9 @@ function resetQuery() {

function toggleQueryPanel(url, name) {
return (dispatch, getState) => {
if (getState().query.typeName !== name) {
dispatch(reset());
}
dispatch(featureTypeSelected(url, name));
dispatch(toggleControl('queryPanel', null));
dispatch(setControlProperty('drawer', 'width', getState().controls.queryPanel.enabled ? 700 : 300));
Expand Down

0 comments on commit 4c7eef1

Please sign in to comment.