added check for json encoder, cleaned up error handling a bit

This commit is contained in:
Martynas Mickevicius
2010-08-06 13:22:04 +03:00
parent 47f67613a2
commit 59f220eb13
5 changed files with 52 additions and 40 deletions

View File

@@ -23,6 +23,12 @@
var imageMap = {
'mouseMoved': function(event, cont) {
// return if no imageMap set
// this can happen if server has no json
if (!this.imageMap) {
return;
}
// get mouse coordinated relative to image
var mouseX = event.pageX - cont.offsetLeft;
var mouseY = event.pageY - cont.offsetTop;