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

Commit 1bca424

Browse files
committed
refactor(calendar) only calling getOptions 1 time per change
Signed-off-by: Josh Kurz <josh.kurz@turner.com>
1 parent 5fc2b19 commit 1bca424

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

demo/calendarDemo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ function CalendarCtrl($scope) {
121121
$scope.uiConfig.calendar.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
122122
$scope.uiConfig.calendar.dayNamesShort = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
123123
$scope.changeTo = 'Hungarian';
124-
};
124+
}
125125
};
126126
/* event sources array*/
127127
$scope.eventSources = [$scope.events, $scope.eventSource, $scope.eventsF];
128128
$scope.eventSources2 = [$scope.calEventsExt, $scope.eventsF, $scope.events];
129129
}
130-
/* EOF */
130+
/* EOF */

src/calendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ angular.module('ui.calendar', [])
186186
};
187187

188188
scope.init = function(){
189-
getOptions();
190189
scope.calendar.fullCalendar(options);
191190
};
192191

@@ -213,6 +212,7 @@ angular.module('ui.calendar', [])
213212
};
214213

215214
scope.destroy();
215+
getOptions();
216216
scope.init();
217217
eventSourcesWatcher.subscribe(scope);
218218
eventsWatcher.subscribe(scope, function(newTokens, oldTokens) {

0 commit comments

Comments
 (0)