climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1503452 - /incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/Timeline.js
Date Mon, 15 Jul 2013 20:24:17 GMT
Author: joyce
Date: Mon Jul 15 20:24:17 2013
New Revision: 1503452

URL: http://svn.apache.org/r1503452
Log:
CLIMATE-195 - Timeline doesn't redraw on window resize

- Add binding to $window that fires on a resize event. This calls the
  the instantiated timeline's checkRedraw function which handles
  redrawing the timeline if necessary.

Modified:
    incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/Timeline.js

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/Timeline.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/Timeline.js?rev=1503452&r1=1503451&r2=1503452&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/Timeline.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/Timeline.js Mon Jul 15 20:24:17
2013
@@ -16,7 +16,7 @@
 //
 
 // Directive for dealing with the Leaflet map
-App.Directives.directive('timeline', function($rootScope) {
+App.Directives.directive('timeline', function($rootScope, $window) {
 	return {
 		restrict: 'C',
 		replace: true,
@@ -30,6 +30,11 @@ App.Directives.directive('timeline', fun
 	            // Instantiate timeline object.
 	            $rootScope.timeline = new links.Timeline(document.getElementById('OCWtimeline'));
 
+				// Redraw the timeline whenever the window is resized
+				angular.element($window).bind('resize', function() {
+					$rootScope.timeline.checkResize();
+				});
+
 				var options = {
 						"width": "100%",
 						"showCurrentTime": false,



Mime
View raw message