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

Suggestion: Any way to show some loading type behaviour #1

Open
sunscreem opened this issue Jul 2, 2016 · 0 comments
Open

Suggestion: Any way to show some loading type behaviour #1

sunscreem opened this issue Jul 2, 2016 · 0 comments

Comments

@sunscreem
Copy link

This is GREAT. Thank you for sharing.

One minor issue. I needed to provide some feedback that something was happening when a user clicks on the button to start showing the modal.

I ended up with this slightly messy method of adding another overlay and removing it when the modal's overlay was shown.

$(".help-modal").on('click', function (e) {
    $("body").append('<div class="overlay"></div>');
    $('.overlay').fadeTo( "fast", 0.5 ); 
    $.loadmodal({
        url: $(this).data('modal-url'),
        id: 'myModal',
        title: $(this).data('modal-title'),
        width: $(this).data('modal-width'),
        onShow: function(){
            $('.overlay').fadeOut(500,function(){ $(this).remove(); });
        },
        buttons:{
            close:function(){}
        }
    });
});

I'm wondering if you've come up with a cleaner way?

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