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

Commit bd62634

Browse files
committed
fix(calendar.js): pass stick true to the renderEvent method closes #84
Signed-off-by: Josh Kurz <josh.kurz@turner.com>
1 parent a9792fc commit bd62634

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

demo/calendarDemo.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ function CalendarCtrl($scope) {
8787
};
8888
/* Change View */
8989
$scope.renderCalender = function(calendar) {
90-
calendar.fullCalendar('render');
90+
if(calendar){
91+
calendar.fullCalendar('render');
92+
}
9193
};
9294
/* config object */
9395
$scope.uiConfig = {

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<link rel="stylesheet" href="../bower_components/fullcalendar/fullcalendar.css">
88
<link rel="stylesheet" href="calendarDemo.css" />
99

10-
<script src="../bower_components/jquery/jquery.js"></script>
10+
<script src="../bower_components/jquery/dist/jquery.js"></script>
1111
<script src="../bower_components/jquery-ui/ui/jquery-ui.js"></script>
1212

1313
<script src="../bower_components/angular/angular.js"></script>

src/calendar.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ angular.module('ui.calendar', [])
237237
};
238238

239239
eventsWatcher.onAdded = function(event) {
240-
scope.calendar.fullCalendar('renderEvent', event);
240+
scope.calendar.fullCalendar('renderEvent', event, true);
241241
};
242242

243243
eventsWatcher.onRemoved = function(event) {
@@ -248,9 +248,6 @@ angular.module('ui.calendar', [])
248248
scope.calendar.fullCalendar('updateEvent', event);
249249
};
250250

251-
scope.destroy();
252-
getOptions();
253-
scope.init();
254251
eventSourcesWatcher.subscribe(scope);
255252
eventsWatcher.subscribe(scope, function(newTokens, oldTokens) {
256253
if (sourcesChanged === true) {
@@ -261,10 +258,8 @@ angular.module('ui.calendar', [])
261258
});
262259

263260
scope.$watch(getOptions, function(newO,oldO){
264-
if(newO !== oldO){
265261
scope.destroy();
266262
scope.init();
267-
}
268263
});
269264
}
270265
};

test/test.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = function (config) {
33
config.set({
44
basePath : '..',
55
files : [
6-
'bower_components/jquery/jquery.js',
6+
'bower_components/jquery/dist/jquery.js',
77
'bower_components/jquery-ui/ui/*.js',
88
'bower_components/angular/angular.js',
99
'bower_components/angular-mocks/angular-mocks.js',

0 commit comments

Comments
 (0)