Fix bug that caused clicking a uiDisclosure to change the url

(closes #4570)
This commit is contained in:
Bryan Housel
2017-11-27 23:42:02 -05:00
parent 385297d993
commit 5a9749c516
+4
View File
@@ -1,4 +1,5 @@
import { dispatch as d3_dispatch } from 'd3-dispatch';
import { event as d3_event } from 'd3-selection';
import { utilRebind } from '../util/rebind';
import { uiToggle } from './toggle';
@@ -43,12 +44,15 @@ export function uiDisclosure(context, key, expandedDefault) {
function toggle() {
d3_event.preventDefault();
_expanded = !_expanded;
if (_updatePreference) {
context.storage('disclosure.' + key + '.expanded', _expanded);
}
hideToggle.classed('expanded', _expanded);
wrap.call(uiToggle(_expanded));
dispatch.call('toggled', this, _expanded);
}
};