изменение расположения окон и autoresize окна сценариев

This commit is contained in:
Dmitry Borisenko
2022-08-16 23:51:25 +02:00
parent 1b07812543
commit f37eb9d630

View File

@@ -45,10 +45,16 @@
}
}
}
$: scenarioTxt, windowHeight();
let height;
function windowHeight() {
height = Math.round(scenarioTxt.split("\n").length) + 1;
}
</script>
{#if show}
<div class="grd-1col1">
<div class="grd-2col1">
<Card title="Конфигуратор">
<div class="grd-2col2">
<select class="slct-lg" bind:value={itemsJsonBind} on:change={() => elementsDropdownChange()}>
@@ -117,10 +123,13 @@
</tbody>
</table>
</Card>
<Card title="Сценарии">
<textarea rows={height} cols="50" bind:value={scenarioTxt} class="px-2 bg-gray-50 border-2 border-gray-200 rounded text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-indigo-500 w-full" />
</Card>
</div>
<div class="grd-1col1">
<Card title="Сценарии">
<textarea bind:value={scenarioTxt} class="ipt-big h-40 w-full" />
<Card>
<div class="grd-2col1">
<button class="btn-lg" on:click={() => saveConfig()}>{"Сохранить"}</button>
<button class="btn-lg" on:click={() => rebootEsp()}>{"Перезагрузить"}</button>