Skip to content

Commit 5aec4a7

Browse files
added autoScroll + pan to selected vehicle
- when expanding a selected payload, the list will automatically scroll it into view - when expanding map is pan to the selected vehicle - changed the color of the little arrow to light grey - updated TODO
1 parent eab5967 commit 5aec4a7

File tree

4 files changed

+33
-11
lines changed

4 files changed

+33
-11
lines changed

TODO

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1+
* on expand scroll to item on list
2+
3+
* add functionality to select which balloon to follow
4+
5+
* adjust colors and fonts of the template to be more slick
6+
7+
* make the global tamplate to landscape, so it fits anything
8+
that is not a phone in portrait mode. This way the app
9+
can be run by desktop browsers as well as handhelds
10+
111
* functionality of menu icons
212
- home (HAB list)
313
- perhas a screen with current location? if phone allows
414
- just a list of all chase cars
515
- just a list of all stations
16+
17+
New idea: Have just home and help icon
18+
- home is just the regular screen
19+
- help cotains credits and useful info
620

721
* resize elements with javascript, so app displays correctly on any browser/mobile/tablet
822

9-
* adjust top and bottom padding with javascript based on browser
10-
iPhone safari's addressbar and bottom bar cover part of the web page.
11-
At least on iOS 4.1, maybe fixed on newer version
12-
1323
* add rotation animation to arrow in vehicle list
1424

15-
* add functionality to select which balloon to follow
1625

1726

1827

css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ header > div,
7171
.header i {
7272
float: right;
7373
font-weight: normal;
74-
color: #000;
74+
color: #aaa;
7575
}
7676
.header i:after { content: "▼"; }
7777

js/app.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,24 @@ $(window).ready(function() {
2828
$('#main').on('click', '.row .header', function() {
2929
var e = $(this).parent();
3030
if(e.hasClass('active')) {
31+
// collapse data for selecte vehicle
3132
e.removeClass('active');
32-
e.find('.data').slideUp();
33+
e.find('.data').hide();
34+
35+
listScroll.refresh();
3336
} else {
37+
// expand data for select vehicle
3438
e.addClass('active');
35-
e.find('.data').slideDown();
39+
e.find('.data').show();
40+
41+
listScroll.refresh();
42+
43+
// auto scroll when expanding an item
44+
var eName = "." + e.parent().attr('class') + " ." + e.attr('class').match(/vehicle\d+/)[0];
45+
listScroll.scrollToElement(eName);
46+
47+
// pan to selected vehicle
48+
panTo(parseInt(e.attr('class').match(/vehicle(\d+)/)[1]));
3649
}
37-
listScroll.refresh();
3850
});
3951
});

js/tracker.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,9 @@ function updateVehicleInfo(index, position) {
495495
//var container = $('vehicle' + index);
496496
var elm = $('.vehicle' + index);
497497
if (elm.length == 0) {
498-
$('.portrait').append('<div class="row vehicle'+index+'"></div>');
499-
$('.landscape').append('<div class="row vehicle'+index+'"></div>');
498+
var active = (index == 0) ? 'active' : '';
499+
$('.portrait').append('<div class="row '+active+' vehicle'+index+'"></div>');
500+
$('.landscape').append('<div class="row '+active+' vehicle'+index+'"></div>');
500501

501502
}
502503

0 commit comments

Comments
 (0)