Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

added a seperate classs to handle the react anim widget

Benjamin6b8a1fa1135c
diff --git a/web/js/animation/wv.anim.widget.js b/web/js/animation/wv.anim.widget.js
index 0114e3fd5..acd4d95f8 100644
--- a/web/js/animation/wv.anim.widget.js
+++ b/web/js/animation/wv.anim.widget.js
@@ -16,20 +16,23 @@ var wv = wv || {};
wv.anim = wv.anim || {};
wv.anim.widget = wv.anim.widget || function(models, config, ui) {
- var self = this;
+ var self = {};
var timeline = ui.timeline;
+ var model = models.date;
var widgetFactory = React.createFactory(Animate.AnimationWidget);
self.init = function() {
var $animateButton = $('#animate-button');
var Widget = widgetFactory({
callback: self.onPressPlay,
- label: 'Frames Per Second'
+ label: 'Frames Per Second',
+ currentDate: model.selected
});
- //mount react component
- ReactDOM.render(Widget, $('#wv-animation-widet-case')[0]);
+ //mount react component
+ ReactDOM.render(Widget, $('#wv-animation-widet-case')[0]);
- self.$widgetCase = $('#wv-animation-widget');
- $animateButton.on('click', self.toggleAnimationWidget)
+ self.$widgetCase = $('#wv-animation-widget');
+ $animateButton.on('click', self.toggleAnimationWidget);
+ model.on('change', self.update)
};
self.toggleAnimationWidget = function() {
return self.$widgetCase.toggleClass('wv-active');