Redraw restrictions panel when dragging sidebar

This commit is contained in:
J Guthrie
2018-11-19 15:12:30 +00:00
parent b7e218a6cb
commit 6137941efd
2 changed files with 17 additions and 0 deletions

View File

@@ -66,6 +66,8 @@ export function uiFieldRestrictions(field, context) {
var _intersection;
var _fromWayID;
var _redrawHandler;
function restrictions(selection) {
_parent = selection;
@@ -301,6 +303,14 @@ export function uiFieldRestrictions(field, context) {
});
}
if (!_redrawHandler) {
_redrawHandler = setInterval(function() {
if (d3_select('#sidebar-resizer').classed('dragging')) {
utilSetDimensions(_container, null);
redraw();
}
}, 50);
}
// This can happen if we've lowered the detail while a FROM way
// is selected, and that way is no longer part of the intersection.
@@ -661,6 +671,8 @@ export function uiFieldRestrictions(field, context) {
d3_select(window)
.on('resize.restrictions', null);
clearInterval(_redrawHandler);
};

View File

@@ -62,6 +62,8 @@ export function uiSidebar(context) {
selection
.style('width', widthPct + '%') // lock in current width
.style('max-width', '85%'); // but allow larger widths
resizer.classed('dragging', true);
})
.on('drag', function() {
var isRTL = (textDirection === 'rtl');
@@ -97,6 +99,9 @@ export function uiSidebar(context) {
}
}
})
.on('end', function() {
resizer.classed('dragging', false);
})
);
var featureListWrap = selection