Fixed first plugin button being smaller than the other ones

This commit is contained in:
WerWolv
2022-04-07 09:07:38 +02:00
parent 3a39c88144
commit a3619d1d3a
+29 -29
View File
@@ -25,34 +25,35 @@
{% endif %} {% endif %}
<div class="quickaccessmenu_TabGroupPanel_1QO7b Panel Focusable"> <div class="quickaccessmenu_TabGroupPanel_1QO7b Panel Focusable">
<div class="quickaccesscontrols_PanelSectionRow_26R5w"> {% for plugin in plugins %}
{% for plugin in plugins %} {% if plugin.tile_view_html|length %}
{% if plugin.tile_view_html|length %} <div class="quickaccesscontrols_PanelSectionRow_26R5w">
<div onclick="loadPlugin('{{ plugin.name }}')" <div onclick="loadPlugin('{{ plugin.name }}')"
class="basicdialog_Field_ugL9c basicdialog_WithChildrenBelow_1RjOd basicdialog_InlineWrapShiftsChildrenBelow_3a6QZ basicdialog_ExtraPaddingOnChildrenBelow_2-owv basicdialog_StandardPadding_1HrfN basicdialog_HighlightOnFocus_1xh2W Panel Focusable" class="basicdialog_Field_ugL9c basicdialog_WithChildrenBelow_1RjOd basicdialog_InlineWrapShiftsChildrenBelow_3a6QZ basicdialog_ExtraPaddingOnChildrenBelow_2-owv basicdialog_StandardPadding_1HrfN basicdialog_HighlightOnFocus_1xh2W Panel Focusable"
style="--indent-level:0;"> style="--indent-level:0;">
<iframe id="tile_view_iframe_{{ plugin.name }}" style="display:block; padding: 0; border: none;" scrolling="no" <iframe id="tile_view_iframe_{{ plugin.name }}" style="display:block; padding: 0; border: none;" scrolling="no"
src="/plugins/load_tile/{{ plugin.name }}"></iframe> src="/plugins/load_tile/{{ plugin.name }}"></iframe>
<script> <script>
(function() { (function() {
let iframe = document.getElementById("tile_view_iframe_{{ plugin.name }}"); let iframe = document.getElementById("tile_view_iframe_{{ plugin.name }}");
tile_iframes.push(document.getElementById("tile_view_iframe_{{ plugin.name }}")); tile_iframes.push(document.getElementById("tile_view_iframe_{{ plugin.name }}"));
iframe.onload = function() { iframe.onload = function() {
let html = iframe.contentWindow.document.children[0]; let html = iframe.contentWindow.document.children[0];
let last_height = 0; let last_height = 0;
setInterval(function() { setInterval(function() {
let height = iframe.contentWindow.document.children[0].scrollHeight; let height = iframe.contentWindow.document.children[0].scrollHeight;
if (height != last_height) { if (height != last_height) {
iframe.height = height + "px"; iframe.height = height + "px";
last_height = height; last_height = height;
} }
}, 100); }, 100);
iframe.contentWindow.document.body.onclick = function () { iframe.contentWindow.document.body.onclick = function () {
loadPlugin('{{ plugin.name }}'); loadPlugin('{{ plugin.name }}');
}; };
} }
})(); })();
</script> </script>
</div>
</div> </div>
{% else %} {% else %}
<div class="quickaccesscontrols_PanelSectionRow_26R5w"> <div class="quickaccesscontrols_PanelSectionRow_26R5w">
@@ -68,5 +69,4 @@
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div>
</div> </div>