Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 28de7d8

Browse files
Abdul HagiAbdul Hagi
authored andcommitted
fix(calendarDemo): update to 1.3.x
Signed-off-by: Abdul Hagi <Abdul.hagi@hotmail.com.com>
1 parent 3794dc0 commit 28de7d8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

demo/calendarDemo.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
/**
22
* calendarDemoApp - 0.9.0
33
*/
4-
angular.module('calendarDemoApp', ['ui.calendar', 'ui.bootstrap']);
4+
angular.module('calendarDemoApp', ['ui.calendar', 'ui.bootstrap'])
5+
.controller('CalendarCtrl', CalendarCtrl);
56

6-
function CalendarCtrl($scope,$compile,uiCalendarConfig) {
7+
function CalendarCtrl($scope, $compile, $timeout, uiCalendarConfig) {
78
var date = new Date();
89
var d = date.getDate();
910
var m = date.getMonth();
1011
var y = date.getFullYear();
11-
12+
1213
$scope.changeTo = 'Hungarian';
1314
/* event source that pulls from google.com */
1415
$scope.eventSource = {
@@ -37,7 +38,7 @@ function CalendarCtrl($scope,$compile,uiCalendarConfig) {
3738
$scope.calEventsExt = {
3839
color: '#f00',
3940
textColor: 'yellow',
40-
events: [
41+
events: [
4142
{type:'party',title: 'Lunch',start: new Date(y, m, d, 12, 0),end: new Date(y, m, d, 14, 0),allDay: false},
4243
{type:'party',title: 'Lunch 2',start: new Date(y, m, d, 12, 0),end: new Date(y, m, d, 14, 0),allDay: false},
4344
{type:'party',title: 'Click for Google',start: new Date(y, m, 28),end: new Date(y, m, 29),url: 'http://google.com/'}
@@ -87,12 +88,14 @@ function CalendarCtrl($scope,$compile,uiCalendarConfig) {
8788
};
8889
/* Change View */
8990
$scope.renderCalender = function(calendar) {
90-
if(uiCalendarConfig.calendars[calendar]){
91-
uiCalendarConfig.calendars[calendar].fullCalendar('render');
92-
}
91+
$timeout(function() {
92+
if(uiCalendarConfig.calendars[calendar]){
93+
uiCalendarConfig.calendars[calendar].fullCalendar('render');
94+
}
95+
});
9396
};
9497
/* Render Tooltip */
95-
$scope.eventRender = function( event, element, view ) {
98+
$scope.eventRender = function( event, element, view ) {
9699
element.attr({'tooltip': event.title,
97100
'tooltip-append-to-body': true});
98101
$compile(element)($scope);

0 commit comments

Comments
 (0)