Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use bootstrap 4 modals as "block ui" - modal screen that blocks input and show "wait a minute.." label?

Tags:

How to use bootstrap 4 modals as "block ui" functionality: to fade screen dinamically on AJAX call (and to show "wait a minute..." label or sandglasses for that moment)?

If you have a modals in the framework that means you also can use them to block UI functionality. But I can't find any API or sample in official documentation...

like image 436
Roman Pokrovskij Avatar asked Apr 09 '18 14:04

Roman Pokrovskij


1 Answers

How I have solved it:

this was added to every page that need "block UI" (actually to root template)

<div class="modal " id="blockAppliactionDialog" tabindex="-1" role="status" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content" style="background-color: transparent; border-width:0;">
            <div class="container pt-4 px-5" style="color:white; font-size:large">
                <h3>Wait a moment..</h3>
            </div>
        </div>
    </div>
</div>

and then I enable it through javascript:

this.$('#blockAppliactionDialog').modal({
            backdrop: 'static',
            keyboard: false
        });
like image 124
Roman Pokrovskij Avatar answered Sep 23 '22 13:09

Roman Pokrovskij