craftpip / angular-confirm

A multipurpose plugin for alert, confirm & dialog for angular1
http://craftpip.github.io/angular-confirm/
MIT License
115 stars 20 forks source link

ngShow / ngHide Classes Get Applied In The $$postDigest Phase Caused confirm box height error #14

Open Woodu opened 7 years ago

Woodu commented 7 years ago

Hi, I'm using angular 1.5.9 and angular-confirm 1.1.0.

Due to this article: https://www.bennadel.com/blog/2853-ngshow-nghide-classes-get-applied-in-the-postdigest-phase-in-angularjs-1-3.htm If I use dom controller with ng-hide or ng-show in confirm box template, the digest will first update confirm box height, then the dom get updated. so I changed some code on line 913~917 :

var thisBox = this;
          $timeout(function asyncTestCheck(){
            console.log($content.outerHeight());
            thisBox.$contentPane.css({
              'height': $content.outerHeight(),
            }).scrollTop(0);
            thisBox.$confirmBox.css(style);
          },0,false);

As a walkaround, I doesnt changed the calculate of contentHeight. Maybe could get fixed in next version.

craftpip commented 7 years ago

Thanks @Woodu for the idea, i will work on a reliable fix to this Your support is appreciated.