Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Ensure namespace exists for timeline config

Mike McGann326ef8bca505
diff --git a/web/js/date/wv.date.timeline.config.js b/web/js/date/wv.date.timeline.config.js
index 36b04a782..a669db133 100644
--- a/web/js/date/wv.date.timeline.config.js
+++ b/web/js/date/wv.date.timeline.config.js
@@ -7,6 +7,10 @@
* @class wv.date.timeline.config
*/
+var wv = wv || {};
+wv.date = wv.date || {};
+wv.date.timeline = wv.date.timeline || {};
+
wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui) {
var self = {};
var tl = ui.timeline;
@@ -42,12 +46,12 @@ wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui
.setUTCFullYear(tl.data.start().getUTCFullYear()-10)),
new Date(tl.data.end()
.setUTCFullYear(tl.data.end().getUTCFullYear()+10))];
-
+
altEnd = new Date(tl.data.start().getUTCFullYear() + tickCountMax,
tl.data.start().getUTCMonth(),
tl.data.start().getUTCDate());
-
+
tl.zoom.drawTicks(tickCount,
tickCountMax,
@@ -132,7 +136,7 @@ wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui
return new Date(d.getUTCFullYear() + yearOffset,
model.selected.getUTCMonth(),
- model.selected.getUTCDate());
+ model.selected.getUTCDate());
};
//Displayed default label
@@ -176,7 +180,7 @@ wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui
});
};
-
+
//Update placement of zoom buttons
$('.zoom-btn').removeClass(function (index, css) {
@@ -504,16 +508,16 @@ wv.date.timeline.config = wv.date.timeline.config || function(models, config, ui
default:
console.log('Invalid Zoom level');
}
-
+
//TODO: Maybe group check, initTicks, and removePadding
tl.ticks.check();
initTicks();
tl.pick.update();
tl.pick.checkLocation();
-
+
};
-
+
//Draw ticks based on zoom level
var initTicks = function(){
tl.ticks.boundary.init();