@push('js')
    <script>
        "use strict";
        $(document).ready(function() {});
        (function($) {
            //ajax modal
            $(document).ready(function() {
                $(document).on('click', '.modal-menu', function(e) {
                    e.preventDefault();
                    let selector = $('#dynamic-content');
                    var title = $(this).data('title');
                    if (title != "" && title != null) {
                        $("#common-modal-title").text(title);
                    }
                    var url = $(this).data('url'); // it will get action url
                    selector.html(''); // leave it blank before ajax call
                    $.ajax({
                            url: url,
                            type: 'get',
                            dataType: 'html'
                        }).done(function(data) {
                            selector.html('').html(data);
                            $('#modal-loader').hide(); // hide ajax loader
                            $('.with_search').select2({
                                dropdownParent: $('#addCurrency')
                            });
                            $('.selectric').selectric();
                        })
                        .fail(function() {
                            $('#dynamic-content').html(
                                '<i class="glyphicon glyphicon-info-sign"></i> {{ __('something_went_wrong_try_again_ellipsis') }}'
                                );
                        });
                });
            });

        })(window.jQuery);
    </script>
@endpush
