For anyone wondering, I found another way to stop the mouse-drag initiating before the mouse-click on the map. Add another variable for the mouse down on the graphic and later remove the variable when done by double clicking.
map.on("dbl-click", function(event){
undoPreEvents();
map.setMapCursor("default");
document.getElementById("popup1").style.display = "none";
dojo.stopEvent(event);
event.preventDefault();
event.stopPropagation();
console.log("Mouse Up");
});
function executeSchool1() {
document.getElementById("popup2").style.display = "block";
doPreEvents();
map.setMapCursor("url('images/yellow_crayon.cur'), auto");
executeSchool1EvtMouse = on(blocks, "mouse-down", function() {
document.getElementById("popup1").style.display = "block";
executeSchool1Evt = on(blocks, "mouse-move", function(e) {
gra = e.graphic.clone();
gra.attributes.ES_Num = 1;
schoolGL.add(gra);
calculatePopES();
document.getElementById("popup2").style.display = "none";
});
});
}
function executeSchool2(evt) {
document.getElementById("popup2").style.display = "block";
doPreEvents();
map.setMapCursor("url('images/green_crayon.cur'), auto");
executeSchool2EvtMouse = on(blocks, "mouse-down", function() {
document.getElementById("popup1").style.display = "block";
executeSchool2Evt = on(blocks, "mouse-move", function(e) {
gra = e.graphic.clone();
gra.attributes.ES_Num = 2;
schoolGL.add(gra);
calculatePopES();
document.getElementById("popup2").style.display = "none";
});
});
}
function clearEvts() {
if (executeSchool1Evt) {
executeSchool1Evt.remove();
executeSchool1EvtMouse.remove();
}
if (executeSchool2Evt) {
executeSchool2Evt.remove();
executeSchool2EvtMouse.remove();
}
}