Fix Angular bug on plans page when using back button
Angular apparently tries to read the DOM that is being manipulated simultaneously by bootstrap, which results it a state inconsistency (since the DOM is changing) and an Angular failure. This change ensure that the modal call happens outside of the initial digest loop and therefore, appears to solve the problem (translation: who the heck knows why it works, but it does). Fixes #1869
This commit is contained in:
parent
bfaa46c499
commit
0a435fa1dc
1 changed files with 4 additions and 2 deletions
|
@ -11,7 +11,7 @@ angular.module('quay').directive('plansDisplay', function () {
|
|||
restrict: 'C',
|
||||
scope: {
|
||||
},
|
||||
controller: function($scope, $element, $routeParams, UserService, PlanService, UIService) {
|
||||
controller: function($scope, $element, $routeParams, $timeout, UserService, PlanService, UIService) {
|
||||
// Monitor any user changes and place the current user into the scope.
|
||||
UserService.updateUserIn($scope);
|
||||
|
||||
|
@ -33,7 +33,9 @@ angular.module('quay').directive('plansDisplay', function () {
|
|||
if ($scope.user && !$scope.user.anonymous) {
|
||||
PlanService.handleNotedPlan();
|
||||
} else {
|
||||
$('#signinModal').modal({});
|
||||
$timeout(function() {
|
||||
$('#signinModal').modal({});
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue