aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/views/details.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-06-19 11:53:39 +0100
committerStruan Donald <struan@exo.org.uk>2013-06-19 12:14:00 +0100
commit6f21e968c74e335b8f5c7b9ecfc968db9c042a5c (patch)
tree958dd19133a60a56d864a439ea7e5aad1331608a /www/js/views/details.js
parent4dbb22f4241260f7debd204cff870ec829bd0aff (diff)
check for, display and send extra details on open311 categories
Diffstat (limited to 'www/js/views/details.js')
-rw-r--r--www/js/views/details.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/www/js/views/details.js b/www/js/views/details.js
index 6b4544a..8da8ca5 100644
--- a/www/js/views/details.js
+++ b/www/js/views/details.js
@@ -68,7 +68,29 @@
if ( FMS.isOffline ) {
this.navigate( 'save_offline' );
} else {
- this.navigate( this.next );
+ var that = this;
+ $.ajax( {
+ url: CONFIG.FMS_URL + '/report/new/category_extras',
+ type: 'POST',
+ data: {
+ category: this.model.get('category'),
+ latitude: this.model.get('lat'),
+ longitude: this.model.get('lon')
+ },
+ dataType: 'json',
+ timeout: 30000,
+ success: function( data, status ) {
+ if ( data ) {
+ that.model.set('category_extras', data.category_extra);
+ that.navigate('details_extra');
+ } else {
+ that.navigate( this.next );
+ }
+ },
+ error: function() {
+ this.navigate( this.next );
+ }
+ } );
}
}
},