os-firewall: only use uuid reference on initial load (https://github.com/opnsense/plugins/issues/1720)

This commit is contained in:
Ad Schellevis
2020-03-10 15:17:52 +01:00
committed by Ad Schellevis
parent 66e2b7a340
commit 8d53eece0b
@@ -1,5 +1,6 @@
<script>
$( document ).ready(function() {
let initial_load = true;
let grid = $("#grid-rules").UIBootgrid({
search:'/api/firewall/filter/searchItem/',
get:'/api/firewall/filter/getItem/',
@@ -12,7 +13,10 @@
// open edit dialog when opened with a uuid reference
if (window.location.hash !== "" && window.location.hash.split("-").length >= 4) {
grid.on('loaded.rs.jquery.bootgrid', function(){
$(".command-edit:eq(0)").clone(true).data('row-id', window.location.hash.substr(1)).click();
if (initial_load) {
$(".command-edit:eq(0)").clone(true).data('row-id', window.location.hash.substr(1)).click();
initial_load = false;
}
});
}
});