diff --git a/assets/templates/asset_audit_list.html b/assets/templates/asset_audit_list.html index de300d7b..5117bbed 100644 --- a/assets/templates/asset_audit_list.html +++ b/assets/templates/asset_audit_list.html @@ -14,10 +14,30 @@ $('#searchButton').focus().click(); return false; }); + $('#searchButton').click(function (e) { + e.preventDefault(); + var url = "{% url 'asset_audit' None %}"; + var id = $("#{{form.query.id_for_label}}").val(); + url = url.replace('None', id); + $.ajax({ + url: url, + success: function(){ + $link = $(this); + // Anti modal inception + if ($link.parents('#modal').length == 0) { + modaltarget = $link.data('target'); + modalobject = ""; + $('#modal').load(url, function (e) { + $('#modal').modal(); + }); + } + }, + error:function(){ + $("#error404").attr("hidden", false); + } + }); + }); }); - function onSearchClick() { - $('#searchButton').attr("href", "{% url 'asset_audit' None %}".replace('None', $('#{{form.query.id_for_label}}').val())); - } function onAuditClick(assetID) { $('#' + assetID).remove(); } @@ -29,12 +49,17 @@