Current section

Files

Jump to
mavu_snippets_ui lib live ce ce_text_snippet_edit.html.heex
Raw

lib/live/ce/ce_text_snippet_edit.html.heex

<section>
<.form let={f} for={@changeset} url="#" as={:step_data} theme={:tw_default} -phx-change={:validate} phx-submit={:save} phx-target={@myself} id={@id} class="w-lg">
<.live_component id="saveblock_top" module={MavuSnippetsUi.Live.Ce.SaveBlock} class="mb-5" />
<%= for l <- @active_language_map do %>
<% placeholder= MavuSnippets.get_default_text_from_element(@celement,l.lang, @context[:snippets_conf]) %>
<div
class="inline-block rounded text-xs uppercase px-2 py-1 ml-2 min-w-[3em] text-center hover:ring-primary-500 hover:ring-2 bg-gray-200"
title={"#{ l.langnum }"}>
<%= l.lang %></div>
<%= input f, l.fieldname, ([ using: :textarea, rows: 5, label: "Text:", placeholder: placeholder ] ++
if connected?(@socket), do: [
"x-data": "{ init() {this.resize();}, resize(){ console.log('#log 3085 RESIZE'); this.$el.style.height = '5px'; this.$el.style.height = $el.scrollHeight + 'px' } }",
# "x-on:input": "resize()"
], else: [])
%>
<% end %>
</.form>
</section>