Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-1146: Timeline expands if collapsed during the tour

Mike McGann6eea2e2ca491
diff --git a/web/js/date/wv.date.timeline.js b/web/js/date/wv.date.timeline.js
index 8e0d66e57..cce7b6b65 100644
--- a/web/js/date/wv.date.timeline.js
+++ b/web/js/date/wv.date.timeline.js
@@ -1862,19 +1862,24 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
init();
$(window).resize(resizeWindow);
- self.toggle = function(){
+ self.toggle = function(now){
var tl = $('#timeline-footer');
var tlz = $('#timeline-zoom');
var tlg = d3.select('#timeline-footer svg > g:nth-child(2)');
var gp = d3.select('#guitarpick');
if(tl.is(':hidden')){
- tl.show('slow',function(){
+ var afterShow = function() {
tlz.show();
$('#timeline').css('right','10px');
tlg.attr('style','clip-path:url("#timeline-boundary")');
gp.attr("style","display:block;clip-path:url(#guitarpick-boundary);");
- });
-
+ };
+ if ( now ) {
+ tl.show();
+ afterShow();
+ } else {
+ tl.show('slow', afterShow);
+ }
}
else{
tlg.attr('style','clip-path:none');
@@ -1885,13 +1890,18 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
}
};
- self.expand = function(){
+ self.expand = function(now){
+ now = now || false;
var tl = $('#timeline-footer, #timeline-zoom');
if (tl.is(":hidden")){
- self.toggle();
+ self.toggle(now);
}
};
+ self.expandNow = function() {
+ self.expand(true);
+ };
+
self.collapse = function(){
var tl = $('#timeline-footer, #timeline-zoom');
if (!tl.is(":hidden")){
diff --git a/web/js/wv.tour.js b/web/js/wv.tour.js
index 00bf458eb..169462a81 100644
--- a/web/js/wv.tour.js
+++ b/web/js/wv.tour.js
@@ -200,7 +200,7 @@ wv.tour = wv.tour || function(models, ui, config) {
var setTourState = function() {
ui.sidebar.expandNow();
ui.sidebar.selectTab("active");
- //ui.dateSliders.expand();
+ ui.timeline.expandNow();
models.proj.selectDefault();
};