aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--www/js/map-OpenLayers.js47
-rw-r--r--www/js/views/around.js8
-rw-r--r--www/templates/en/around.html83
3 files changed, 50 insertions, 88 deletions
diff --git a/www/js/map-OpenLayers.js b/www/js/map-OpenLayers.js
index cd01de1..291d76f 100644
--- a/www/js/map-OpenLayers.js
+++ b/www/js/map-OpenLayers.js
@@ -214,34 +214,6 @@ OpenLayers.Map.prototype.getCurrentSize = function() {
return new OpenLayers.Size(mapDiv.width(), mapDiv.height());
};
-function fixContentHeight(olMap) {
- var footer = $("div[data-role='footer']:visible"),
- content = $("div[data-role='content']:visible:visible"),
- viewHeight = $(window).height(),
- contentHeight = viewHeight - footer.outerHeight();
-
- if ((content.outerHeight() + footer.outerHeight()) !== viewHeight) {
- contentHeight -= (content.outerHeight() - content.height() + 1);
- content.height(contentHeight);
- }
- content.width($(window).width());
- olMap.updateSize();
-}
-
-function ensureNonZeroHeight(containerid) {
- var footer = $("div[id='" + containerid + "'] > div[data-role='footer']"),
- header = $("div[id='" + containerid + "'] > div[data-role='header']"),
- content = $("div[id='" + containerid + "'] > div[data-role='content']"),
- viewHeight = $(window).height(),
- contentHeight = viewHeight - footer.outerHeight() - header.outerHeight();
-
- if ((content.outerHeight() + footer.outerHeight() + header.outerHeight()) !== viewHeight) {
- contentHeight -= (content.outerHeight() - content.height() + 1);
- content.height(contentHeight);
- content.width($(window).width());
- }
- }
-
function show_map(event) {
if (typeof fixmystreet !== 'undefined' && fixmystreet.page == 'around') {
// Immediately go full screen map if on around page
@@ -265,7 +237,6 @@ function show_map(event) {
});
}
- ensureNonZeroHeight();
set_map_config();
$('#mark-here').hide();
@@ -274,8 +245,6 @@ function show_map(event) {
displayProjection: new OpenLayers.Projection("EPSG:4326")
});
- fixContentHeight(fixmystreet.map);
-
fixmystreet.layer_options = OpenLayers.Util.extend({
zoomOffset: fixmystreet.zoomOffset,
transitionEffect: 'resize',
@@ -295,7 +264,6 @@ function show_map(event) {
}
fixmystreet_onload();
- fixContentHeight(fixmystreet.map);
var crosshairsControls, i, markHere, confirm, newX, newY;
@@ -306,19 +274,6 @@ function show_map(event) {
for (i = 0; i < crosshairsControls.length; ++i) {
crosshairsControls[i].reposition();
}
- // Also reposition the "Tap here to mark this point" button:
- markHere = $('#mark-here');
- confirm = $('#confirm');
- newX = $(window).width() / 2 - markHere.width() / 2;
- newY = $(window).height() * 4 / 5 - markHere.height() / 2;
- markHere.css({
- left: newX + "px",
- top: newY + "px"
- });
- confirm.css({
- left: newX + "px",
- top: newY + "px"
- });
}
@@ -327,6 +282,8 @@ function show_map(event) {
//mark_here();
//} else {
fixmystreet.nav.activate();
+ $('#view-my-reports').show();
+ $('#login-options').show();
$('#mark-here').show();
//}
}
diff --git a/www/js/views/around.js b/www/js/views/around.js
index bd12933..6fcb426 100644
--- a/www/js/views/around.js
+++ b/www/js/views/around.js
@@ -111,10 +111,14 @@
if ( this.model.get('lat') ) {
$('#cancel').show();
$('#confirm').show();
+ $('#view-my-reports').hide();
+ $('#login-options').hide();
$('#mark-here').hide();
} else {
$('#cancel').hide();
$('#confirm').hide();
+ $('#view-my-reports').show();
+ $('#login-options').show();
$('#mark-here').show();
}
},
@@ -122,6 +126,8 @@
onClickMark: function() {
$('#cancel').show();
$('#confirm').show();
+ $('#view-my-reports').hide();
+ $('#login-options').hide();
$('#mark-here').hide();
},
@@ -129,6 +135,8 @@
e.preventDefault();
$('#cancel').hide();
$('#confirm').hide();
+ $('#view-my-reports').show();
+ $('#login-options').show();
$('#mark-here').show();
this.model.set('lat', null);
this.model.set('lon', null);
diff --git a/www/templates/en/around.html b/www/templates/en/around.html
index 827e7f6..2529f09 100644
--- a/www/templates/en/around.html
+++ b/www/templates/en/around.html
@@ -3,7 +3,7 @@
<a href="#" id="cancel" class="ui-btn-right nodisplay">Cancel</a>
</div>
-<div class="table-cell">
+<div data-role="content">
<div id="locating" class="nodisplay" style="text-align: center; padding-top: 50%">
<p>
Getting Your Location
@@ -27,51 +27,48 @@
<input type="button" id="locate_search" value="Search">
</p>
</div>
- <div class="container" data-enhance="false">
- <a id="mark-here" class="nodisplay">
- New Report Here
- </a>
- <a id="confirm" class="nodisplay">
- Confirm location
- </a>
- <div class="content" role="main">
- <form action="" method="post" name="mapForm" id="mapForm" enctype="multipart/form-data" class="validate">
+ <script type="text/javascript">
+ var fixmystreet = {
+ 'page': 'around',
+ 'area': '',
+ 'all_pins': '',
+ 'latitude': localStorage.latitude,
+ 'longitude': localStorage.longitude,
- <input type="hidden" name="pc" id="pc" value="">
- <input type="hidden" name="latitude" id="fixmystreet.latitude" value="">
- <input type="hidden" name="longitude" id="fixmystreet.longitude" value="">
- <script type="text/javascript">
- var fixmystreet = {
- 'page': 'around',
- 'area': '',
- 'all_pins': '',
- 'latitude': localStorage.latitude,
- 'longitude': localStorage.longitude,
+ 'zoom': 4,
+ 'numZoomLevels': 5,
+ 'zoomOffset': 13,
+ 'map_type': "",
+ 'pins': [ ]
- 'zoom': 4,
- 'numZoomLevels': 5,
- 'zoomOffset': 13,
- 'map_type': "",
- 'pins': [ ]
+ };
+ </script>
- };
-
- $('#fixmystreet\\.latitude').val( localStorage.latitude );
- $('#fixmystreet\\.longitude').val( localStorage.longitude );
- $('#pc').val( localStorage.pc );
- </script>
+ <div id="map_box" class="mapbox">
+ <div id="map"></div>
+ <p id="sub_map_links">
+ <a id="hide_pins_link" rel="nofollow" href="">Hide pins</a>
+ <a id="relocate" rel="nofollow" href="">Recenter</a>
+ <a id="search" rel="nofollow" href="">Search</a>
+ <a id="reports" rel="nofollow" href="">R</a>
+ <a id="login" rel="nofollow" href="">L</a>
+ </p>
+ </div>
+ <div class="frontpage-menu">
+ <a id="view-my-reports" class="nodisplay" data-role="button" href="#">
+ <strong>My Reports</strong>
+ <span class="draft_count">2</span> Draft Reports
+ </a>
+ <a id="login-options" class="nodisplay loggedin" data-role="button" href="#">
+ <strong class="signout">Sign Out</strong>
+ (Signed in as <strong>Timothy Jones</strong>)
+ </a>
- <div id="map_box">
- <div id="map"></div>
- <p id="sub_map_links">
- <a id="hide_pins_link" rel="nofollow" href="">Hide pins</a>
- <a id="relocate" rel="nofollow" href="">Recenter</a>
- <a id="search" rel="nofollow" href="">Search</a>
- <a id="reports" rel="nofollow" href="">R</a>
- <a id="login" rel="nofollow" href="">L</a>
- </p>
- </div>
- </form>
- </div>
+ <a id="mark-here" data-role="button" data-theme="a" style="position:absolute;bottom:0;left:15px;right:15px;">
+ New Report Here
+ </a>
+ <a id="confirm" data-role="button" data-theme="a" class="nodisplay" style="position:absolute;bottom:0;left:15px;right:15px;">
+ Confirm location
+ </a>
</div>
</div>