aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-09-18 18:06:36 +0100
committerStruan Donald <struan@exo.org.uk>2013-09-18 18:06:36 +0100
commitd7e747708ae27459a831649098830619372e16eb (patch)
tree837f819b30a1c48cf6947649b2087a80a2b5fd82 /src
parentc5ba24bc13276061cfdb3abc23ffad6c2eb1b92b (diff)
Change initial map page if locating draft with no location
Only display the cancel button in the toolbar, use a different button with different text to indicate you are adding a location to an existing report Fixes #138
Diffstat (limited to 'src')
-rw-r--r--src/css/fms.css2
-rw-r--r--src/js/views/around.js20
-rw-r--r--src/templates/en/around.html3
3 files changed, 20 insertions, 5 deletions
diff --git a/src/css/fms.css b/src/css/fms.css
index 7131bad..d8d4563 100644
--- a/src/css/fms.css
+++ b/src/css/fms.css
@@ -548,11 +548,13 @@
#reposition,
#view-my-reports,
#login-options,
+ #locate-here,
#mark-here {
display: block;
z-index: 3000;
}
+ #locate-here .ui-btn-text,
#mark-here .ui-btn-text{
font-size:1.2em;
padding: 0.5em 0;
diff --git a/src/js/views/around.js b/src/js/views/around.js
index 0ac3b8b..fff6908 100644
--- a/src/js/views/around.js
+++ b/src/js/views/around.js
@@ -18,6 +18,7 @@
'vclick #cancel': 'onClickCancel',
'vclick #confirm-map': 'onClickReport',
'vclick #mark-here': 'onClickMark',
+ 'vclick #locate-here': 'onClickMark',
'vclick #reposition': 'onClickReposition',
'vclick a.address': 'goAddress',
'submit #postcodeForm': 'search'
@@ -208,6 +209,7 @@
$('#view-my-reports').hide();
$('#login-options').hide();
$('#mark-here').hide();
+ $('#locate-here').hide();
$('#postcodeForm').hide();
if ( fixmystreet.map ) {
fixmystreet.markers.setVisibility(false);
@@ -215,11 +217,19 @@
fixmystreet.bbox_strategy.deactivate();
}
} else {
- $('#cancel').hide().removeClass('ui-btn-left');
+ if ( FMS.currentDraft.isPartial() ) {
+ $('#cancel').addClass('ui-btn-left').show();
+ $('#view-my-reports').hide();
+ $('#login-options').hide();
+ $('#locate-here').show();
+ } else {
+ $('#cancel').hide().removeClass('ui-btn-left');
+ $('#view-my-reports').show();
+ $('#login-options').show();
+ $('#mark-here').show();
+ $('#locate-here').hide();
+ }
$('#confirm-map').hide();
- $('#view-my-reports').show();
- $('#login-options').show();
- $('#mark-here').show();
$('#postcodeForm').show();
$('#reposition').hide();
if ( fixmystreet.map ) {
@@ -257,7 +267,6 @@
fixmystreet_activate_drag();
// force pins to be refetched and displayed
fixmystreet.bbox_strategy.update({force: true});
- this.displayButtons(false);
if ( this.model.isPartial() ) {
FMS.clearCurrentDraft();
} else {
@@ -271,6 +280,7 @@
this.model.set('lat', null);
this.model.set('lon', null);
}
+ this.displayButtons(false);
},
decrementDraftCount: function() {
diff --git a/src/templates/en/around.html b/src/templates/en/around.html
index bf37f2e..47bc329 100644
--- a/src/templates/en/around.html
+++ b/src/templates/en/around.html
@@ -40,6 +40,9 @@
<a id="mark-here" data-role="button" data-theme="a" class="map-bottom-btn">
New Report Here
</a>
+ <a id="locate-here" data-role="button" data-theme="a" class="map-bottom-btn">
+ Set Report Location
+ </a>
<a id="reposition" data-role="button" data-theme="c" class="map-bottom-btn nodisplay">
Reposition Report Here
</a>