From d2ebed847e0214e4654337947c8d3c15ee7c87f9 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Fri, 2 May 2014 11:49:16 -0500 Subject: [PATCH] fix(modal): Remove modal flicker, closes #1150 --- js/angular/service/modal.js | 5 ++++- test/html/modal.html | 1 + test/unit/angular/service/modal.unit.js | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/angular/service/modal.js b/js/angular/service/modal.js index 6f58802bea..d1de50bc1c 100644 --- a/js/angular/service/modal.js +++ b/js/angular/service/modal.js @@ -94,7 +94,10 @@ function($rootScope, $document, $compile, $timeout, $ionicPlatform, $ionicTempla var modalEl = angular.element(self.modalEl); self.el.classList.remove('hide'); - $document[0].body.classList.add('modal-open'); + $timeout(function(){ + $document[0].body.classList.add('modal-open'); + }, 400) + if(!self.el.parentElement) { modalEl.addClass(self.animation); diff --git a/test/html/modal.html b/test/html/modal.html index 062a0a4743..4b7ee0963f 100644 --- a/test/html/modal.html +++ b/test/html/modal.html @@ -40,6 +40,7 @@