
<div id="order" class="modal fade" tabindex="-1" style="display: none;" aria-hidden="true">
    <div class="modal-dialog modal-full" id="order_list">

    </div>
</div>

<script>
    // Setup module
    // ------------------------------
    var Order = function () {
        var _componentOrder = function() {
            $(document).on('click', 'a.read-order', function (e) {
                e.preventDefault();
                var id = $(this).attr('data-id');
                var module = $(this).attr('data-module');
                var action = $(this).attr('data-action');
                console.log(id);

                $("#order_list").load("/admin/" + module, { action: action, id: id }, function (data, success) {
                    // console.log(data);
                    $("#order").modal({
                        show: true
                    });
                });
            });
        }


        return {

            // Initialize all components
            initComponents: function() {
                _componentOrder();
            },

            // Initialize core
            initCore: function() {
                Order.initComponents();
            }
        }
    }();

    document.addEventListener('DOMContentLoaded', function() {
        Order.initCore();
    });


</script>