aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-11-15 15:50:47 +0000
committerStruan Donald <struan@exo.org.uk>2012-11-15 15:50:47 +0000
commit9348aa4815ced56758331f4d7eefd9ddd3df8032 (patch)
tree1b87562f45cd4ae854ed18be34e38e65413dfa93 /www/js
parentc5caf8264ed2a1b9801700d58f3c827a6a79111d (diff)
fix variable name clashes
Diffstat (limited to 'www/js')
-rw-r--r--www/js/report.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/www/js/report.js b/www/js/report.js
index e1a2de7..244a24c 100644
--- a/www/js/report.js
+++ b/www/js/report.js
@@ -1,5 +1,5 @@
function Report(spec) {
- var id = -1;
+ var my_id = -1;
var props = spec || {
lat: 0,
lon: 0,
@@ -12,7 +12,7 @@ function Report(spec) {
};
return {
- id: function() { return id; },
+ id: function() { return my_id; },
lat: function(lat) { if ( lat ) { props.lat = lat; } return props.lat; },
lon: function(lon) { if ( lon ) { props.lon = lon; } return props.lon; },
title: function(title) { if ( title ) { props.title = title; } return props.title; },
@@ -37,10 +37,10 @@ function Report(spec) {
t = props.time;
}
},
- load: function(id) {
+ load: function(load_id) {
var reports = localStorage.getObject('reports');
- props = reports[id];
- id = id;
+ props = reports[load_id];
+ my_id = load_id;
},
save: function() {
var reports = localStorage.getObject('reports');
@@ -48,11 +48,11 @@ function Report(spec) {
reports = [];
}
props.time = new Date();
- if ( id != -1 ) {
- reports[id] = props;
+ if ( my_id != -1 ) {
+ reports[my_id] = props;
} else {
reports.push( props );
- id = reports.length - 1;
+ my_id = reports.length - 1;
}
localStorage.setObject('reports', reports);
},
@@ -61,7 +61,7 @@ function Report(spec) {
this.load(del_id);
}
var reports = localStorage.getObject('reports');
- delete report[id];
+ delete reports[my_id];
localStorage.setObject('reports', reports);
},
reset: function() {