PageSourceSearch

https://hemis.guldu.uz/static/assets/828eb143/js/ajax-modal-popup.js?v=1784213601

js guldu.uz collected 2026-10-03 17:45:11 UTC 2,293 bytes, 39 lines download raw bytes

1$(function () {
2    //get the click of modal button to create / update item
3    //we get the button by class not by ID because you can only have one id on a page and you can
4    //have multiple classes therefore you can have multiple open modal buttons on a page all with or without
5    //the same link.
6//we use on so the dom element can be called again if they are nested, otherwise when we load the content once it kills the dom element and wont let you load anther modal on click without a page refresh
7    $(document).on('click', '.showModalButton', function () {
8        //check if the modal is open. if it's open just reload content not whole modal
9        //also this allows you to nest buttons inside of modals to reload the content it is in
10        //the if else are intentionally separated instead of put into a function to get the 
11        //button since it is using a class not an #id so there are many of them and we need
12        //to ensure we get the right button and content.
13        let message = $(this).data('message');
14        if (message === undefined || message.length > 0 && confirm(message)) {
15            if ($(this).attr('modal-class') != undefined)
16                $('#modal').find('.modal-dialog').removeClass('modal-lg').addClass($(this).attr('modal-class'));
17            var modalData = $('#modal').data('bs.modal');
18            if (modalData && modalData.isShown) {
19                $('#modal').find('#modalContent')
20                    .html('')
21                    .load($(this).attr('value'));
22                //dynamiclly set the header for the modal
23                document.getElementById('modalHeader').innerHTML = '<h4>' + $(this).attr('title') + '</h4>';
24            } else {
25                //if modal isn't open; open it and load content
26                $('#modal').modal('show')
27                    .find('#modalContent')
28                    .html('')
29                    .load($(this).attr('value'));
30                //dynamiclly set the header for the modal
31
32                document.getElementById('modalHeader').innerHTML = '<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>' + $(this).attr('title');
33            }
34        }
35
36        return false;
37    });
38});
39                

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.