Simplify adding results widget

This commit is contained in:
Mark Veidemanis 2022-08-26 07:20:30 +01:00
parent 996463b869
commit c499f18b1b
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 4 additions and 9 deletions

View File

@ -106,7 +106,6 @@
for (var i = 0; i < scripts.length; i++) { for (var i = 0; i < scripts.length; i++) {
eval(scripts[i].innerHTML); eval(scripts[i].innerHTML);
} }
</script> </script>
{% endif %} {% endif %}

View File

@ -1,11 +1,6 @@
{% load static %} {% load static %}
<script>
if (typeof grid != "undefined") {
grid.removeWidget("drilldown-widget-results");
}
</script>
<div id="drilldown-widget" style="display: none;"> <div id="drilldown-widget" style="display: block;">
<div id="drilldown-widget-results" class="grid-stack-item" gs-w="10" gs-h="30" gs-y="10" gs-x="1"> <div id="drilldown-widget-results" class="grid-stack-item" gs-w="10" gs-h="30" gs-y="10" gs-x="1">
<div class="grid-stack-item-content"> <div class="grid-stack-item-content">
<div class="panel"> <div class="panel">
@ -55,8 +50,10 @@
</div> </div>
</div> </div>
</div> </div>
<script> <script>
if (typeof grid != "undefined") { if (typeof grid != "undefined") {
grid.removeWidget("drilldown-widget-results");
//var contents = $("#drilldown-widget").outerHTML; //var contents = $("#drilldown-widget").outerHTML;
var contents = document.getElementById("drilldown-widget"); var contents = document.getElementById("drilldown-widget");
var scripts = contents.getElementsByTagName("script"); var scripts = contents.getElementsByTagName("script");
@ -68,5 +65,4 @@
eval(scripts[i].innerHTML); eval(scripts[i].innerHTML);
} }
} }
</script>
</script>