aboutsummaryrefslogtreecommitdiffstats
path: root/web/js.js
diff options
context:
space:
mode:
authormatthew <matthew>2007-01-30 16:36:14 +0000
committermatthew <matthew>2007-01-30 16:36:14 +0000
commit6fb2f613971725f3d399b944d378fbdd2385695d (patch)
tree1e73bf6ee7fe438d8b48061478e33265c51b646a /web/js.js
parent31911a584d9d7cf8800ee95203c4bc35c945cca6 (diff)
Use Yahoo!'s event handling to get around possible loading error; cope
with edge of the map.
Diffstat (limited to 'web/js.js')
-rw-r--r--web/js.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/web/js.js b/web/js.js
index 45140816a..26a95d520 100644
--- a/web/js.js
+++ b/web/js.js
@@ -11,14 +11,14 @@
YAHOO.util.Event.onContentReady('compass', function() {
var points = this.getElementsByTagName('a');
- points[1].onclick = function() { pan(0, tileheight); return false; };
- points[3].onclick = function() { pan(tilewidth, 0); return false; };
- points[4].onclick = function() { pan(-tilewidth, 0); return false; };
- points[6].onclick = function() { pan(0, -tileheight); return false; };
- points[0].onclick = function() { pan(tilewidth, tileheight); return false; };
- points[2].onclick = function() { pan(-tilewidth, tileheight); return false; };
- points[5].onclick = function() { pan(tilewidth, -tileheight); return false; };
- points[7].onclick = function() { pan(-tilewidth, -tileheight); return false; };
+ YAHOO.util.Event.addListener(points[1], 'click', function() { pan(0, tileheight); return false; });
+ YAHOO.util.Event.addListener(points[3], 'click', function() { pan(tilewidth, 0); return false; });
+ YAHOO.util.Event.addListener(points[4], 'click', function() { pan(-tilewidth, 0); return false; });
+ YAHOO.util.Event.addListener(points[6], 'click', function() { pan(0, -tileheight); return false; });
+ YAHOO.util.Event.addListener(points[0], 'click', function() { pan(tilewidth, tileheight); return false; });
+ YAHOO.util.Event.addListener(points[2], 'click', function() { pan(-tilewidth, tileheight); return false; });
+ YAHOO.util.Event.addListener(points[5], 'click', function() { pan(tilewidth, -tileheight); return false; });
+ YAHOO.util.Event.addListener(points[7], 'click', function() { pan(-tilewidth, -tileheight); return false; });
});
YAHOO.util.Event.onContentReady('map', function() {
@@ -105,6 +105,7 @@ function urls_loaded(o) {
for (var i=0; i<6; i++) {
var ii = (i + o.argument[1]);
for (var j=0; j<6; j++) {
+ if (tiles[i][j] == null) continue;
var jj = (j + o.argument[0]);
var id = 't'+ii+'.'+jj;
var xx = x+j;