You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by sk...@apache.org on 2013/08/22 20:00:52 UTC

svn commit: r1516527 - in /incubator/climate/trunk/rcmet/src/main/ui/app/js: app.js directives/Timeline.js

Author: skhudiky
Date: Thu Aug 22 18:00:51 2013
New Revision: 1516527

URL: http://svn.apache.org/r1516527
Log:
CLIMATE-275: Fix Timeline bug

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

Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js?rev=1516527&r1=1516526&r2=1516527&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/app.js Thu Aug 22 18:00:51 2013
@@ -28,6 +28,12 @@ App.Directives = angular.module('ocw.dir
 App.Controllers = angular.module('ocw.controllers', []);
 App.Filters = angular.module('ocw.filters', []);
 
+/*We need to manually start angular as we need to wait for 
+ * the google charting libs to be ready*/
+google.setOnLoadCallback(function () {
+  angular.bootstrap(document.body, ['ocw']);
+});
+
 angular.module('ocw', ['ocw.services', 'ocw.directives', 'ocw.controllers', 'ocw.filters', 'ui.date', 'ui.bootstrap', 'ui.compat', 'ui.state'])
 .config(
     [        '$stateProvider', '$routeProvider', '$urlRouterProvider',

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=1516527&r1=1516526&r2=1516527&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 Thu Aug 22 18:00:51 2013
@@ -23,27 +23,22 @@ App.Directives.directive('timeline', fun
 		transclude: true,
 		template: '<div id="OCWtimeline"></div>',
 		link: function(scope, element, attrs) {
-			
-	    	google.setOnLoadCallback(initTimeline);
-	        
-	    	function initTimeline() {
-	            // Instantiate timeline object.
-	            $rootScope.timeline = new links.Timeline(document.getElementById('OCWtimeline'));
+			// 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();
-				});
+			// Redraw the timeline whenever the window is resized
+			angular.element($window).bind('resize', function() {
+				$rootScope.timeline.checkResize();
+			});
 
-				var options = {
-						"width": "100%",
-						"showCurrentTime": false,
-						"moveable": false,
-						"zoomable": false
-				};
+			var options = {
+				"width": "100%",
+				"showCurrentTime": false,
+				"moveable": false,
+				"zoomable": false
+			};
 
-				$rootScope.timeline.draw([], options);
-	        }
+			$rootScope.timeline.draw([], options);
 		}
 	}
 });