inc_order_confirmation.tpl 1 KB
Newer Older
Andy J's avatar
p2  
Andy J committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
<div class="modal modal-center fade" id="ppp-modal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <h2 id="pp-loading-body"><i class="fa fa-spinner fa-spin fa-fw"></i> Ihre Bestellung wird abgeschlossen</h2>
            </div>
        </div>
    </div>
</div>

<script>
$(function() {
    var submitted = false;
    // $(window).bind('unload', function (e) { console.log('unload'); return false; });
    //$(window).bind('beforeunload', function (e) { console.log('beforeunload', submitted); return submitted; });

    $('#complete_order').on('submit', function() {
        submitted = true;

        $(this).find('input[type="submit"]')
            .addClass('disabled')
            .attr('disabled', true);

        $('#ppp-modal').modal({
            backdrop: 'static'
        });

        $('#ppp-modal').modal('show');

        return true;
    });
});
</script>