Fix error in floatingUIExample.js.

Script would crash if the user left clicked somewhere not on an overlay.
This commit is contained in:
Zander Otavka 2015-08-04 15:06:12 -07:00
parent 22453aa3ce
commit a21fa94f14

View file

@ -170,10 +170,10 @@ function onMouseDown(event) {
function onMouseUp(event) {
if (event.isLeftButton) {
var overlay = OverlayManager.findAtPoint({ x: event.x, y: event.y });
if (overlay === mouseDown.overlay) {
if (overlay && overlay === mouseDown.overlay) {
if (overlay.attachedPanel === bluePanel) {
overlay.destroy();
} else if (overlay) {
} else {
var oldPos = overlay.offsetPosition;
var newPos = {
x: Number(oldPos.x),