Add safety check in code for moving the handle

An element that has 'display: none' has a height of zero, and the logic
for the handle assumed that this was never the case. This could cause
the handle to end up at the wrong coordinates.
This commit is contained in:
Samuel Mannehed 2016-10-18 13:32:00 +02:00
parent 59cd99bc38
commit f75e4d3caa

View File

@ -556,6 +556,11 @@ var UI;
.getBoundingClientRect();
var margin = 10;
// These heights need to be non-zero for the below logic to work
if (handleHeight === 0 || controlbarBounds.height === 0) {
return;
}
var newY = viewportRelativeY;
// Check if the coordinates are outside the control bar