Skip to content

Commit

Permalink
fix(calendar.js): do not alter original execution context angular-ui#107
Browse files Browse the repository at this point in the history
  • Loading branch information
jkurz committed May 12, 2014
1 parent d6550d1 commit be423a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ angular.module('ui.calendar', [])
// In this way the function will be safely executed on the next digest.

var args = arguments;
$timeout(function(){
functionToWrap.apply(this, args);
});
functionToWrap.apply(this, args);
$scope.$apply();
};
}

Expand Down
3 changes: 0 additions & 3 deletions test/calendar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,6 @@ describe('uiCalendar', function () {

fullCalendarConfig[key]();

$timeout.flush();

expect($rootScope.$apply.callCount).toBe(functionCount);
expect(scope.uiConfig.calendar[key]).toHaveBeenCalled();
$rootScope.$apply.isSpy = false;
Expand Down Expand Up @@ -413,7 +411,6 @@ describe('uiCalendar', function () {
fullCalendarConfig[key]();

scope.$apply();
$timeout.flush();

expect($rootScope.$apply.callCount).toBe(functionCount*2);
expect(scope.uiConfig.calendar[key]).toHaveBeenCalled();
Expand Down

0 comments on commit be423a3

Please sign in to comment.