disable pointer-events during transitions, closes #436

This commit is contained in:
Adam Bradley
2014-01-20 09:47:18 -06:00
parent 343279dae4
commit 628252b1cd
3 changed files with 12 additions and 1 deletions

View File

@@ -345,9 +345,15 @@ angular.module('ionic.service.view', ['ui.router'])
this.setAnimationClass(opts.parentElement, animationClass, opts.navDirection);
opts.enteringElement.addClass('ng-enter');
// disable any pointer-events from being able to fire
document.body.classList.add('disable-pointer-events');
// start the animations
if(opts.leavingElement) {
$animate.leave(opts.leavingElement);
$animate.leave(opts.leavingElement, function() {
// re-enable pointer-events
document.body.classList.remove('disable-pointer-events');
});
}
$animate.enter(opts.enteringElement, opts.parentElement);