fix page refresh
This commit is contained in:
		@@ -3,13 +3,13 @@
 | 
			
		||||
{% block title %}Standort{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block breadcrumb %}
 | 
			
		||||
  <li class="breadcrumb-item"><a href="{% url 'billard:location_index' %}">Standorte</a></li>
 | 
			
		||||
  <li class="breadcrumb-item active">{{ location.code }}</li>
 | 
			
		||||
    <li class="breadcrumb-item"><a href="{% url 'billard:location_index' %}">Standorte</a></li>
 | 
			
		||||
    <li class="breadcrumb-item active">{{ location.code }}</li>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
    <div class="row">
 | 
			
		||||
{% include 'billard/location_detail_ajax.html' %}
 | 
			
		||||
        {% include 'billard/location_detail_ajax.html' %}
 | 
			
		||||
    </div>
 | 
			
		||||
    <div id="modal-wrapper">
 | 
			
		||||
    </div>
 | 
			
		||||
@@ -17,20 +17,25 @@
 | 
			
		||||
 | 
			
		||||
{% block js %}
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
    var interval;
 | 
			
		||||
$(document).ready(function() {
 | 
			
		||||
    $.ajaxSetup({ cache: false });
 | 
			
		||||
    interval = window.setInterval(refresh_page, 1000);
 | 
			
		||||
});
 | 
			
		||||
        var interval;
 | 
			
		||||
        $(document).ready(function () {
 | 
			
		||||
            $.ajaxSetup({cache: false});
 | 
			
		||||
            interval = window.setInterval(refresh_page, 1000);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
function refresh_page() {
 | 
			
		||||
    $('#desk_data').load('#');
 | 
			
		||||
    $('#modal-wrapper').load('{% url 'billard:account_modal' loc_pk=pk %}', function() {
 | 
			
		||||
        if ( $('#accountsmodal').length ) {
 | 
			
		||||
            window.clearInterval(interval);
 | 
			
		||||
            $('#accountsmodal').modal('show');
 | 
			
		||||
        function refresh_page() {
 | 
			
		||||
 | 
			
		||||
            $('#row').load('#');
 | 
			
		||||
            $('#modal-wrapper').load('{% url 'billard:account_modal' loc_pk=pk %}', function () {
 | 
			
		||||
                if ($('#accountsmodal').length) {
 | 
			
		||||
                    window.clearInterval(interval);
 | 
			
		||||
                    $('#accountsmodal').modal('show');
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            setTimeout(function () {
 | 
			
		||||
                location.reload();
 | 
			
		||||
            }, 1000);
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
    </script>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
		Reference in New Issue
	
	Block a user