diff --git a/Web/ui.js b/Web/ui.js index 55f889a..a7a4c31 100644 --- a/Web/ui.js +++ b/Web/ui.js @@ -228,9 +228,10 @@ function CheckForActions(actionPoint, action) { var checkit = false; var inside = false; for (var index = 0; index < uiActions.length; index++) { - if (action == "leftclick" && uiActions[index].funcLeftClick !== null) checkit = true; - if (action == "rightclick" && uiActions[index].funcRightClick !== null) checkit = true; - if (action == "mouseover" && uiActions[index].funcMouseover !== null) checkit = true; + checkit = true; + if (action == "leftclick" && uiActions[index].funcLeftClick == null) checkit = false; + if (action == "rightclick" && uiActions[index].funcRightClick == null) checkit = false; + if (action == "mouseover" && uiActions[index].funcMouseover == null) checkit = false; checklocation = uiActions[index]; var point = newPointFromPair(actionPoint.pageX - checklocation.shapePoints.offsetx, actionPoint.pageY - checklocation.shapePoints.offsety); if (checkit) { @@ -258,14 +259,16 @@ function CheckForActions(actionPoint, action) { //console.log("Is inside"); switch (action) { case "leftclick": - if (checklocation.funcLeftClick != null) { + if (checklocation.funcLeftClick == null) { } + else { checklocation.funcLeftClick(actionPoint, checklocation); - //console.log("Successfully did a UI action"); + //console.log("Successfully did a left-click UI action"); return true; } break; case "mouseover": - if (checklocation.funcMouseover != null) { + if (checklocation.funcMouseover == null) { } + else { checklocation.funcMouseover(actionPoint, checklocation); //console.log("Successfully did a UI action"); return true; @@ -677,6 +680,7 @@ function actionStruct(shapeText, shapePoints, theObject=null, funcLeftClick=null funcRightClick: funcRightClick, funcMouseover: funcMouseover, } + //if (shapeText == "line") console.log("Creating a line: " + JSON.stringify(struct)); shapePoints.shapeText = shapeText; return struct; }