Skip to content

Commit 2779ae2

Browse files
swap scrollbar side; chasecar disabled on desktops
1 parent d56b6b2 commit 2779ae2

File tree

3 files changed

+57
-23
lines changed

3 files changed

+57
-23
lines changed

cache.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# version 45
2+
# version 46
33

44
# gogole maps files
55
http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg

css/main.css

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Habitat Mobile Tracker
22
* Main style sheet
3-
*
3+
*
44
*/
55

66
html, body {
@@ -11,6 +11,25 @@ html, body {
1111
overflow: hidden;
1212
}
1313

14+
.scrollStyleV {
15+
z-index: 100;
16+
width: 5px;
17+
bottom: 6px;
18+
top: 6px;
19+
left: 1px;
20+
position: absolute;
21+
}
22+
23+
.scrollStyleV > div {
24+
position: absolute;
25+
background: none repeat scroll 0 0 padding-box rgba(0, 0, 0, 0.5);
26+
border: 1px solid rgba(255, 255, 255, 0.9);
27+
border-radius: 3px 3px 3px 3px;
28+
position: absolute;
29+
width: 100%;
30+
z-index: 100;
31+
}
32+
1433
#map img {
1534
max-width: none;
1635
}
@@ -34,7 +53,7 @@ html, body {
3453
#loading .bar {
3554
position: relative;
3655
width: 200px;
37-
height: 5px;
56+
height: 5px;
3857
border-radius: 3px;
3958
background: #005C76;
4059
}
@@ -80,7 +99,7 @@ header > div {
8099
}
81100

82101
.nav {
83-
list-style: none outside none;
102+
list-style: none outside none;
84103
margin: 0;
85104
padding: 0;
86105
height: 40px;
@@ -111,8 +130,8 @@ header > div {
111130
color: #fff;
112131
line-height: 45px;
113132
font-size: 35px;
114-
}
115-
.nav > li.last { border: 0; }
133+
}
134+
.nav > li.last { border: 0; }
116135
.nav > li:active { background-color: #33b5e5; }
117136
.nav > li:hover { border-bottom: 5px solid #fff; }
118137

@@ -142,7 +161,7 @@ header > div {
142161
border: 0;
143162
}
144163
#main .header span {
145-
overflow: hidden;
164+
overflow: hidden;
146165
display: block;
147166
width: 90%;
148167
float: left;
@@ -166,24 +185,24 @@ header > div {
166185
position: relative;
167186
z-index: 4;
168187
}
169-
#main .row .data img {
188+
#main .row .data img {
170189
position: absolute;
171190
z-index: 2;
172191
bottom: 40%;
173192
right: 25%;
174193
opacity: 0.6;
175194
}
176-
#main .row .header .graph {
195+
#main .row .header .graph {
177196
position: absolute;
178197
bottom: -1px;
179198
right: 25px;
180199
width: 60px;
181200
height: 40px;
182201
}
183-
#main .row .data dt > i {
202+
#main .row .data dt > i {
184203
font-size: 12px;
185204
}
186-
#main .row .data a {
205+
#main .row .data a {
187206
text-decoration: none;
188207
color: #00A3D3;
189208
}
@@ -314,7 +333,7 @@ header > div {
314333
position: absolute;
315334
right: -28px;
316335
top: 3px;
317-
}
336+
}
318337

319338
@media only screen and (min-width: 321px) {
320339
.portrait { display: none; }
@@ -340,25 +359,25 @@ header > div {
340359
width: 160px;
341360
padding-left: 10px;
342361
}
343-
#main .data dl > dt {
362+
#main .data dl > dt {
344363
color: #000;
345364
line-height: 11px;
346365
margin-top: 5px;
347366
font-weight: bold;
348367
font-size: 14px;
349368
}
350-
#main .data dl > dd {
369+
#main .data dl > dd {
351370
padding: 0;
352371
margin: 0;
353372
text-transform:uppercase;
354373
line-height: 11px;
355374
font-size: 11px;
356375
}
357-
#main .data dl > dt.receivers {
376+
#main .data dl > dt.receivers {
358377
font-size: 10px;
359378
font-weight: normal;
360379
}
361-
#main .data dl > dd.receivers {
380+
#main .data dl > dd.receivers {
362381
font-size: 10px;
363382
}
364383
#main .row .data img {
@@ -389,28 +408,28 @@ header > div {
389408
padding-right: 10px;
390409
width: 20%;
391410
}
392-
#main .data dl > dt {
411+
#main .data dl > dt {
393412
color: #000;
394413
line-height: 11px;
395414
margin-top: 15px;
396415
font-weight: bold;
397416
font-size: 14px;
398417
}
399-
#main .data dl > dd {
418+
#main .data dl > dd {
400419
padding: 0;
401420
margin: 0;
402421
text-transform:uppercase;
403422
line-height: 11px;
404423
font-size: 11px;
405424
}
406-
#main .data dl > dt.receivers {
425+
#main .data dl > dt.receivers {
407426
font-size: 10px;
408427
font-weight: normal;
409428
}
410-
#main .data dl > dd.receivers {
429+
#main .data dl > dd.receivers {
411430
font-size: 10px;
412431
}
413-
#main .row .header .graph {
432+
#main .row .header .graph {
414433
width: 150px;
415434
}
416435
}

js/app.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ function checkSize() {
7474
window.onresize = checkSize;
7575
window.onchangeorientation = checkSize;
7676

77+
// detect if mobile
78+
var is_mobile = false;
79+
80+
if(
81+
navigator.userAgent.match(/Android/i)
82+
|| navigator.userAgent.match(/iPhone/i)
83+
|| navigator.userAgent.match(/iPod/i)
84+
|| navigator.userAgent.match(/iPad/i)
85+
|| navigator.userAgent.match(/Windows Phone/i)
86+
|| navigator.userAgent.match(/webOS/i)
87+
|| navigator.userAgent.match(/BlackBerry/i)
88+
) is_mobile = true;
89+
90+
91+
7792
// functions
7893

7994
var positionUpdateHandle = function() {
@@ -164,7 +179,7 @@ $(window).ready(function() {
164179
checkSize();
165180

166181
// add inline scroll to vehicle list
167-
listScroll = new iScroll('main', { hScrollbar: false, hScroll: false, snap: false });
182+
listScroll = new iScroll('main', { hScrollbar: false, hScroll: false, snap: false, scrollbarClass: 'scrollStyle' });
168183

169184
// confirm dialog when launchnig a native map app with coordinates
170185
$('#main').on('click', '#launch_mapapp', function() {
@@ -355,7 +370,7 @@ $(window).ready(function() {
355370
// The position is displayed in top right corner of the screen
356371
// This should be very handly for in the field tracking
357372
//setTimeout(function() {updateCurrentPosition(50.27533, 3.335166);}, 5000);
358-
if(navigator.geolocation) {
373+
if(navigator.geolocation && is_mobile) {
359374
// if we have geolocation services, show the locate me button
360375
// the button pants the map to the user current location
361376
$("#locate-me,.chasecar").show();

0 commit comments

Comments
 (0)