diff options
author | Struan Donald <struan@exo.org.uk> | 2012-11-30 17:04:35 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-11-30 17:04:35 +0000 |
commit | 59a091deffc24c9075a53c00027d83924b4ebfdd (patch) | |
tree | 1159fae88a3da0799cdc4869e90d3801c41b4829 /www/js | |
parent | ee83279fe540754ccae130bc493287655306f7ae (diff) |
use slidey transitions
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/mobile.js | 18 | ||||
-rw-r--r-- | www/js/mobile_config.js | 1 |
2 files changed, 14 insertions, 5 deletions
diff --git a/www/js/mobile.js b/www/js/mobile.js index e87cecd..29ea0d7 100644 --- a/www/js/mobile.js +++ b/www/js/mobile.js @@ -21,12 +21,18 @@ function touchmove(e) { } /* location code */ -function show_around( lat, long ) { +function show_around( lat, long, use_transition ) { + + var options = { transition: 'slide' }; + if ( use_transition ) { + options = { transition: use_transition, reverse: true }; + } + pc = $('#pc').val(); localStorage.latitude = lat; localStorage.longitude = long; localStorage.pc = pc || ''; - $.mobile.changePage('around.html'); + $.mobile.changePage('around.html', options ); return false; } @@ -92,7 +98,7 @@ function lookup_string(q) { } if ( valid_locations == 1 ) { - show_around( latitude, longitude ); + show_around( latitude, longitude, 'slideup' ); } else if ( valid_locations === 0 ) { location_error('Location not found'); $('#pc').select(); @@ -101,7 +107,7 @@ function lookup_string(q) { $('#multiple').remove(); var multiple_html = '<ul id="multiple"><li>Multiple locations found, please select one:'; for ( i = 0; i < multiple.length; i++ ) { - multiple_html += '<li><a href="#" onclick="show_around( ' + multiple[i].latitude + ',' + multiple[i].longitude +')">' + multiple[i].address + '</a></li>'; + multiple_html += '<li><a href="#" onclick="show_around( ' + multiple[i].latitude + ',' + multiple[i].longitude +', \'slideup\')">' + multiple[i].address + '</a></li>'; } multiple_html += '</ul>'; $('#front-howto').hide(); @@ -116,6 +122,8 @@ function lookup_string(q) { function locate() { $("#multiple").remove(); + delete localStorage.currentReport; + var pc = $('#pc').val(); if (!pc) { @@ -126,7 +134,7 @@ function locate() { if ( valid_postcode( pc ) ) { jQuery.get( CONFIG.MAPIT_URL + 'postcode/' + pc + '.json', function(data, status) { if ( status == 'success' ) { - show_around( data.wgs84_lat, data.wgs84_lon ); + show_around( data.wgs84_lat, data.wgs84_lon, 'slideup' ); } else { alert('Could not locate postcode'); } diff --git a/www/js/mobile_config.js b/www/js/mobile_config.js index ef96235..d208fd9 100644 --- a/www/js/mobile_config.js +++ b/www/js/mobile_config.js @@ -1,3 +1,4 @@ $(document).bind("mobileinit", function(){ $.mobile.ignoreContentEnabled = true; + $.mobile.defaultPageTransition = 'slide'; }); |