aboutsummaryrefslogtreecommitdiffstats
path: root/web/js.js
diff options
context:
space:
mode:
authormatthew <matthew>2007-02-02 00:27:37 +0000
committermatthew <matthew>2007-02-02 00:27:37 +0000
commit47c7b7f91ba874a77f6d72b4453634058614dc2b (patch)
tree8a7ce25dfc71008d5e33cc5779189c99d2023829 /web/js.js
parentc51ffd543a71bb94bebaa015a1bf7a269d85f499 (diff)
Need to preventDefault() for this to work.
Diffstat (limited to 'web/js.js')
-rw-r--r--web/js.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/web/js.js b/web/js.js
index 26a95d520..970f15588 100644
--- a/web/js.js
+++ b/web/js.js
@@ -9,16 +9,21 @@
*
*/
+function compass_pan(e, a) {
+ YAHOO.util.Event.preventDefault(e);
+ pan(a.x, a.y);
+}
+
YAHOO.util.Event.onContentReady('compass', function() {
var points = this.getElementsByTagName('a');
- 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.addListener(points[1], 'click', compass_pan, { x:0, y:tileheight });
+ YAHOO.util.Event.addListener(points[3], 'click', compass_pan, { x:tilewidth, y:0 });
+ YAHOO.util.Event.addListener(points[4], 'click', compass_pan, { x:-tilewidth, y:0 });
+ YAHOO.util.Event.addListener(points[6], 'click', compass_pan, { x:0, y:-tileheight });
+ YAHOO.util.Event.addListener(points[0], 'click', compass_pan, { x:tilewidth, y:tileheight });
+ YAHOO.util.Event.addListener(points[2], 'click', compass_pan, { x:-tilewidth, y:tileheight });
+ YAHOO.util.Event.addListener(points[5], 'click', compass_pan, { x:tilewidth, y:-tileheight });
+ YAHOO.util.Event.addListener(points[7], 'click', compass_pan, { x:-tilewidth, y:-tileheight });
});
YAHOO.util.Event.onContentReady('map', function() {
@@ -105,7 +110,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;
+ if (tiles[i][j] == null) continue;
var jj = (j + o.argument[0]);
var id = 't'+ii+'.'+jj;
var xx = x+j;