Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fade animation is somehow broken. #233

Closed
Blackskyliner opened this issue Feb 20, 2014 · 2 comments
Closed

Fade animation is somehow broken. #233

Blackskyliner opened this issue Feb 20, 2014 · 2 comments

Comments

@Blackskyliner
Copy link
Contributor

I had problems closing the Modal in my application.

Therefore I think the default fade animations may break under some circumstances as it happend to me. I patched it with a simple visibility check.

The problem was that it stopped at beforeHideLoad... Then I tinkered a bit and found out, that fadeOut didn't called the complete function if it was already hidden (dunno why it is this way in my application - using jQuery v1.10.2). The loader icon will be hidden after adding the content and though if I then tried closing the modal it broke as the complete function wasn't called.

My patch:

$.nmAnims({
    fade: {
        hideBg: function(nm, clb) {
            if($( nm.elts.bg ).css( "visibility", "hidden" ).is( ":hidden" ) === true){
                clb();
            }else{
                nm.elts.bg.fadeOut(clb);
            }
        },
        hideLoad: function(nm, clb) {
            if($( nm.elts.load ).css( "visibility", "hidden" ).is( ":hidden" ) === true){
                clb();
            }else{
                nm.elts.load.fadeOut(clb);
            }
        },
        hideCont: function(nm, clb) {
            if($( nm.elts.cont ).css( "visibility", "hidden" ).is( ":hidden" ) === true){
                clb();
            }else{
                nm.elts.cont.css('overflow', 'hidden').fadeOut(clb);
            }
        }        
    }
});

I think it may be not always necessary but why don't check just for the sake of not having those problems under some/special circumstances.

@Blackskyliner
Copy link
Contributor Author

It seems not to solve all problems... I will now investigate further what my additional libraries do to this animations.... As I now got the problem with modal-chaining (a link in a modal, changing content inside modal etc.), because the show animations have the same problem but if I add those checks there it will break them... If I catch the faulty lib I will post it here so anyone knows the incompatibility...

@Blackskyliner
Copy link
Contributor Author

Okay. Found the incompatibility: jquery.animate-enhanced plugin v1.08

http://github.com/benbarnett/jQuery-Animate-Enhanced
http://benbarnett.net
@benpbarnett

But it seems to be an issue of their plugin: benbarnett/jquery-animate-enhanced#128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant