aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rwxr-xr-xweb/index.cgi6
-rw-r--r--web/js2.js5
2 files changed, 8 insertions, 3 deletions
diff --git a/web/index.cgi b/web/index.cgi
index 972a46dd0..72cb42a4c 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: index.cgi,v 1.38 2006-10-06 16:15:38 matthew Exp $
+# $Id: index.cgi,v 1.39 2006-10-07 17:55:10 matthew Exp $
# TODO
# Nothing is done about the update checkboxes - not stored anywhere on anything!
@@ -552,9 +552,11 @@ EOF
} else {
$img_type = '<img';
}
+ my $imgw = '254px';
+ my $imgh = '254px';
$out .= <<EOF;
<div id="map"><div id="drag">
- $img_type id="t2.2" name="tile_$tl" src="$tl_src" style="top:0px; left:0px;">$img_type id="t2.3" name="tile_$tr" src="$tr_src" style="top:0px; left:254px;"><br>$img_type id="t3.2" name="tile_$bl" src="$bl_src" style="top:254px; left:0px;">$img_type id="t3.3" name="tile_$br" src="$br_src" style="top:254px; left:254px;">
+ $img_type id="t2.2" name="tile_$tl" src="$tl_src" style="top:0px; left:0px;">$img_type id="t2.3" name="tile_$tr" src="$tr_src" style="top:0px; left:$imgw;"><br>$img_type id="t3.2" name="tile_$bl" src="$bl_src" style="top:$imgh; left:0px;">$img_type id="t3.3" name="tile_$br" src="$br_src" style="top:$imgh; left:$imgw;">
$pins
</div></div>
EOF
diff --git a/web/js2.js b/web/js2.js
index 598cf32a9..c38646984 100644
--- a/web/js2.js
+++ b/web/js2.js
@@ -128,9 +128,10 @@ function update_tiles(dx, dy, noMove) {
}
}
var horizontal = floor(horizontal/6);
+ var vertical = floor(vertical/6);
+ if (!horizontal && !vertical) return;
x += horizontal;
tile_x = mod((tile_x + horizontal), 6);
- var vertical = floor(vertical/6);
y -= vertical;
tile_y = mod((tile_y + vertical), 6);
@@ -202,6 +203,7 @@ function drag_move(e) {
in_drag = true;
last_mouse_pos = mouse_pos;
mouse_pos = point;
+ YAHOO.log('Updating with '+(mouse_pos.x-last_mouse_pos.x)+','+(mouse_pos.y-last_mouse_pos.y));
update_tiles(mouse_pos.x-last_mouse_pos.x, mouse_pos.y-last_mouse_pos.y);
return false;
}
@@ -215,6 +217,7 @@ function drag_check() {
}
function drag_start(e) {
+ YAHOO.log('drag start');
if (!e) var e = window.event;
//if (e.stopPropagation) e.stopPropagation();
var point = get_posn(e);